
    (?e6                         d dl Zd dlZd dlmZ d dlmZ d dlm	Z
 d dlmZ  edgdd          d	             Z ed
gdd          d             Z edgdd          d             Zd Zd Zd Zd Zd ZdS )    N)
same_color)image_comparison)art3dzlegend_plot.pngTmpl20)remove_textstylec                     t          j        t          d                    \  } }t          j        d          }|                    |d|z
  ddd	           |                    ||dz
  ddd
	           |                                 d S )N3d
projection
subplot_kw
      oyzz=1)zdirlabelzz=-1)pltsubplotsdictnparangeplotlegend)figaxxs      Hlib/python3.11/site-packages/mpl_toolkits/mplot3d/tests/test_legend3d.pytest_legend_plotr       s    ldd&;&;&;<<<GC
	"AGGAq1uc5G111GGAq1uc6G222IIKKKKK    zlegend_bar.pngc                  @   t          j        t          d                    \  } }t          j        d          }|                    ||ddd          }|                    ||d d d	         d
dd          }|                    |d         |d         gddg           d S )Nr
   r   r   r   r   edgem)r   aligncolorr   gr   updown)r   r   r   r   r   barr   )r   r   r   b1b2s        r   test_legend_barr.      s    ldd&;&;&;<<<GC
	"A	13fC	8	8B	1TTrT7F#	>	>BIIr!ubentVn-----r!   z	fancy.pngc                  J   t          j        t          d                    \  } }|                    t	          j        d          t	          j        dd          t	          j        dd          dd           |                    t	          j        d          t	          j        dd	d
          d           |                    t	          j        dd          t	          j        d          t	          j        dd          ddd           |	                    dddd           d S )Nr
   r   r   r   r   zo--liner   r   r'   scatter      ?errorbar)xerrzerrr   z
lower left   z	My legend   )locncolstitle	numpoints)
r   r   r   r   r   r   fullr2   r4   r   )r   r   s     r   
test_fancyr>      s    ldd&;&;&;<<<GCGGBIbMM272q>>272q>>5GOOOJJry}}biAr22)JDDDKKA	"rwr2s*  6 6 6II,a{aIHHHHHr!   c                  v   ddgddgg} ddgddggd	dgd
dggg}d
dgddggd	dgddggg}t          j        | dd          }t          j        |d          }t          j        |dd	          }t          j        t	          d                    \  }}|                    |           |                    |           |                    |           |                    |||gg d          }|j        \  }	}
}t          |||f|	|
|f          D ]*\  }}|	                                d         |j
        k    sJ +d S )N)r   r3   )r3   r8   )g333333?333333?)皙?rA   gffffff?rA   g?g?r3   r@   g?z--   )
linestyleslwz-.)rC   :r
   r   r   )line1line2zline 3r   )r   Line3DCollectionr   r   r   add_collectionr   legend_handleszipget_linestyles_dash_pattern)lines1lines2lines3lc1lc2lc3r   r   legh1h2h3ohlhs                 r   !test_linecollection_scaled_dashesrZ   )   s    8X"67FRy2r(#r2hR%9:FRy2r(#r2hR%9:F

 DQ
?
?
?C

 D
9
9
9C

 CB
?
?
?Cldd&;&;&;<<<GCccc
))S#sO%A%A%A
B
BC#JBBsCoB|44 : :B  ""1%)999999: :r!   c                  n   t          j        t          d                    \  } }|                    ddgddgd           t	          j        dgdgdgd          g}|                    |dgd	          }|d                                         |j        d                                         k    sJ d S )
Nr
   r   r   r   r8   v)markerAardvark)r<   )	r   r   r   r2   r   Line3Dr   
get_markerrJ   )r   r   handlesrT   s       r   test_handlerline3drb   =   s    ldd&;&;&;<<<GCJJ1v1vcJ***|QC!qc#6667G
))Gj\Q)
7
7C1:  ""c&8&;&F&F&H&HHHHHHHr!   c                     t           j        ddddf         \  } }| |z  }g d}t          j        t	          d                    \  }}|                    | ||g d|d	          }|                                \  }}|g d
k    sJ t          d |D                       sJ t          d t          ||          D                       sJ d S )Nr8   r   )bluez#00FF00redr
   r   r   r      2   bothlevelscolorsextend)z
$x = 10.0$z
$x = 30.0$z
$x = 50.0$c              3   T   K   | ]#}t          |t          j        j                  V  $d S N)
isinstancempllinesLine2D.0as     r   	<genexpr>z/test_contour_legend_elements.<locals>.<genexpr>P   s1      @@1z!SY-..@@@@@@r!   c              3   `   K   | ])\  }}t          |                                |          V  *d S ro   )r   	get_colorru   rv   cs      r   rw   z/test_contour_legend_elements.<locals>.<genexpr>Q   sL       1 11a !++--++ 1 1 1 1 1 1r!   )	r   mgridr   r   r   contourlegend_elementsallrK   )	r   r   hrl   r   r   csartistslabelss	            r   test_contour_legend_elementsr   F   s   8AbD!B$JDAq	AA'''Fldd&;&;&;<<<GC	Aq!LLL	O	OB((**OGV???????@@@@@@@@@@ 1 1w//1 1 1 1 1 1 1 1 1 1r!   c                  .   t           j        ddddf         \  } }| |z  }t          j        t	          d                    \  }}|                    | ||g dg dd	          }|j                            d
           |j                            d           |	                                 |
                                \  }}|g dk    sJ d}t          d |D                       sJ t          d t          ||          D                       sJ d S )Nr8   r   r
   r   r   rf   )#FFFF00#FF00FFz#00FFFFri   rj   re   rd   )z$x \leq -1e+250s$z$10.0 < x \leq 30.0$z$30.0 < x \leq 50.0$z$x > 1e+250s$)rd   r   r   re   c              3   T   K   | ]#}t          |t          j        j                  V  $d S ro   )rp   rq   patches	Rectanglert   s     r   rw   z0test_contourf_legend_elements.<locals>.<genexpr>f   s1      EEz!S[233EEEEEEr!   c              3   `   K   | ])\  }}t          |                                |          V  *d S ro   )r   get_facecolorrz   s      r   rw   z0test_contourf_legend_elements.<locals>.<genexpr>g   sN       : :1a !//++Q// : : : : : :r!   )r   r|   r   r   r   contourfcmapset_over	set_underchangedr~   r   rK   )	r   r   r   r   r   r   r   r   expected_colorss	            r   test_contourf_legend_elementsr   U   sd   8AbD!B$JDAq	AAldd&;&;&;<<<GC	Q1\\\===" 
 
$ 
$B GUGfJJLLL((**OGV ' ' ' ' ' ' ' <OEEWEEEEEEEE : :w88: : : : : : : : : :r!   c                     t          j        g dg dg dg          } t          j        | gd          }t	          j        ddi          \  }}|                    d	           |                    |          }|                                }|j	        d
         
                                |
                                k                                    sJ d S )N)r   r   r   )r   r8   r8   )r8   r   r8   surfacer1   r   r
   r   kr   )r   asarrayr   Poly3DCollectionr   r   set_edgecoloradd_collection3dr   rJ   r   r   )vertsmeshr   r   handlerT   s         r   test_legend_Poly3dCollectionr   k   s    J			999iii899E!5';;;Dl|T&:;;;GCs  &&F
))++Cq!//11##%%&'*suu- - - - -r!   )numpyr   
matplotlibrq   matplotlib.colorsr   matplotlib.testing.decoratorsr   matplotlib.pyplotpyplotr   mpl_toolkits.mplot3dr   r    r.   r>   rZ   rb   r   r   r    r!   r   <module>r      sW           ( ( ( ( ( ( : : : : : :       & & & & & & $%4III  JI #$$wHHH. . IH. ;-T'CCCI I DCI: : :(I I I1 1 1: : :,
- 
- 
- 
- 
-r!   