
VW-                 @   s   d  d l  m Z m Z m Z m Z d  d l m Z d  d l Z d  d l	 m
 Z
 d  d l j Z d  d l m Z m Z d  d l j Z d d   Z e d d	 g  d
 d    Z e d d g  d d    Z e d d g  d d    Z e d d    Z e d k rd  d l Z e j   d S)    )absolute_importdivisionprint_functionunicode_literals)sixN)assert_array_almost_equal)image_comparisoncleanupc              C   s_   t  j d d d  d d d  f \ }  } d | d |  } d | |  d } | |  | | f S)N   y              Y@      r   )npmgrid)YXUV r   [/s/python-3.5.2/amd64_ubu14/lib/python3.5/site-packages/matplotlib/tests/test_streamplot.pyvelocity_field   s    +r   baseline_imagesZstreamplot_colormap_test_imagec              C   sW   t    \ }  } } } t j |  | | | d | d d d d d t j j t j   d  S)Ncolordensityg333333?	linewidthr   cmap)r   plt
streamplotcmZautumnZcolorbar)r   r   r   r   r   r   r   test_colormap   s    'r    Zstreamplot_linewidth_test_imagec              C   s   t    \ }  } } } t j | | | |  } d | | j   } d
 } t j |  | | | d d | d | g d d d	 | d  S)N   g      9@g      >@r   g      ?g      ?r   kr   g?)r   r   sqrtmaxr   r   )r   r   r   r   ZspeedZlwdfr   r   r   test_linewidth   s    /r&   Z$streamplot_masks_and_nans_test_imagec              C   s   t    \ }  } } } t j | j d t } d | d d  d d  f <t j j | d | } t j | d  d  d  d  f <t j d d  - t	 j
 |  | | | d	 | d
 t	 j j Wd  QRXd  S)Ndtyper   (   <   mask   invalidignorer   r   )r   r   zerosshapeboolmaarraynanerrstater   r   r   ZBlues)r   r   r   r   r*   r   r   r   test_masks_and_nans&   s    r5   c              C   s   t  j   }  t j d d d  } t j d d d  } t j | |  \ } } t j   j d d  |  j } t  j	 | | t j
 |  t j |  d | t |  j j d d d d  S)Nr!   
   r+   r             Z	transform         decimalr   )r+   r:   r;   r<   )r   axesr   linspacemeshgridmtransformsZAffine2D	translateZ	transDataZbarbssincosr   ZdataLimZbounds)axxytransr   r   r   test_streamplot_limits1   s    .rK   __main__)
__future__r   r   r   r   Zmatplotlib.externalsr   numpyr   Znumpy.testingr   Zmatplotlib.pyplotZpyplotr   Zmatplotlib.testing.decoratorsr   r	   Zmatplotlib.transformsZ
transformsrC   r   r    r&   r5   rK   __name__nose	runmoduler   r   r   r   <module>   s   "
