
    g                        d dl Z 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 e j                          dk(  rdnd       d        Zd Zd Zd Zd Zd Zy)    N)
same_color)image_comparison)art3dzlegend_plot.pngTmpl20)remove_textstylec                      t        j                  t        d            \  } }t        j                  d      }|j                  |d|z
  ddd	       |j                  ||dz
  ddd
	       |j                          y )N3d
projection
subplot_kw
      oyzz=1)zdirlabelzz=-1)pltsubplotsdictnparangeplotlegend)figaxxs      e/var/www/dash_apps/app1/venv/lib/python3.12/site-packages/mpl_toolkits/mplot3d/tests/test_legend3d.pytest_legend_plotr       sc    lldd&;<GC
		"AGGAq1uc5G1GGAq1uc6G2IIK    zlegend_bar.pngc                     t        j                  t        d            \  } }t        j                  d      }|j                  ||ddd      }|j                  ||d d d	   d
dd      }|j                  |d   |d   gddg       y )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|    lldd&;<GC
		"A	13fC	8B	1TrT7F#	>BIIr!ubentVn-r!   z	fancy.pngarm64gI+?)r   r   tolc                  2   t        j                  t        d            \  } }|j                  t	        j
                  d      t	        j                  dd      t	        j                  dd      dd       |j                  t	        j
                  d      t	        j
                  dd	d
      d       |j                  t	        j                  dd      t	        j
                  d      t	        j                  dd      ddd       |j                  dddd       y )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   fullr4   r6   r   )r   r   s     r   
test_fancyr@      s     lldd&;<GCGGBIIbM2772q>2772q>5GOJJryy}biiAr2)JDKKA		"rwwr2s*  6II,a{aIHr!   c                  T   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            \  }}|j                  |       |j                  |       |j                  |       |j                  |||gg d      }|j                  \  }	}
}t        |||f|	|
|f      D ]'  \  }}|j                         d   |j                  k(  r'J  y )N)r   r5   )r5   r:   )g333333?333333?)皙?rC   gffffff?rC   g?g?r5   rB   g?z--   )
linestyleslwz-.)rE   :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_dashesr\   )   sI    8X"67FRy2r(#r2hR%9:FRy2r(#r2hR%9:F

 
 DQ
?C

 
 D
9C

 
 CB
?Clldd&;<GCccc
))S#sO%A
BC##JBBsCoB|4 :B  "1%)9)9999:r!   c                  D   t        j                  t        d            \  } }|j                  ddgddgd       t	        j
                  dgdgdgd      g}|j                  |dgd	      }|d   j                         |j                  d   j                         k(  sJ y )
Nr
   r   r   r   r:   v)markerAardvark)r>   )	r   r   r   r4   r   Line3Dr   
get_markerrL   )r   r   handlesrV   s       r   test_handlerline3drd   =   s    lldd&;<GCJJ1v1vcJ*||QC!qc#67G
))Gj\Q)
7C1:  "c&8&8&;&F&F&HHHHr!   c                  b   t         j                  ddddf   \  } }| |z  }g d}t        j                  t	        d            \  }}|j                  | ||g d|d	      }|j                         \  }}|g d
k(  sJ t        d |D              sJ t        d t        ||      D              sJ y )Nr:   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   d   K   | ](  }t        |t        j                  j                         * y wN)
isinstancempllinesLine2D.0as     r   	<genexpr>z/test_contour_legend_elements.<locals>.<genexpr>P   s!     @1z!SYY--.@   .0c              3   V   K   | ]!  \  }}t        |j                         |       # y wrq   )r   	get_colorrw   rx   cs      r   ry   z/test_contour_legend_elements.<locals>.<genexpr>Q   s)      11a !++-+ 1   '))	r   mgridr   r   r   contourlegend_elementsallrM   )	r   r   hrn   r   r   csartistslabelss	            r   test_contour_legend_elementsr   F   s    88AbD!B$JDAq	AA'Flldd&;<GC	Aq!L	OB((*OGV????@@@@@ 1w/1 1 1 1r!   c                     t         j                  ddddf   \  } }| |z  }t        j                  t	        d            \  }}|j                  | ||g dg dd	      }|j                  j                  d
       |j                  j                  d       |j                          |j                         \  }}|g dk(  sJ d}t        d |D              sJ t        d t        ||      D              sJ y )Nr:   r   r
   r   r   rh   )#FFFF00#FF00FFz#00FFFFrk   rl   rg   rf   )z$x \leq -1e+250s$z$10.0 < x \leq 30.0$z$30.0 < x \leq 50.0$z$x > 1e+250s$)rf   r   r   rg   c              3   d   K   | ](  }t        |t        j                  j                         * y wrq   )rr   rs   patches	Rectanglerv   s     r   ry   z0test_contourf_legend_elements.<locals>.<genexpr>f   s!     Ez!S[[223Erz   c              3   V   K   | ]!  \  }}t        |j                         |       # y wrq   )r   get_facecolorr}   s      r   ry   z0test_contourf_legend_elements.<locals>.<genexpr>g   s*      :1a !//+Q/ :r   )r   r   r   r   r   contourfcmapset_over	set_underchangedr   r   rM   )	r   r   r   r   r   r   r   r   expected_colorss	            r   test_contourf_legend_elementsr   U   s    88AbD!B$JDAq	AAlldd&;<GC	Q1\=" 
 
$B GGUGGfJJL((*OGV ' ' ' ' <OEWEEEE :w8: : : :r!   c                     t        j                  g dg dg dg      } t        j                  | gd      }t	        j
                  ddi      \  }}|j                  d	       |j                  |      }|j                         }|j                  d
   j                         |j                         k(  j                         sJ y )N)r   r   r   )r   r:   r:   )r:   r   r:   surfacer3   r   r
   r   kr   )r   asarrayr   Poly3DCollectionr   r   set_edgecoloradd_collection3dr   rL   r   r   )vertsmeshr   r   handlerV   s         r   test_legend_Poly3dCollectionr   k   s    JJ	9i89E!!5';Dll|T&:;GCs  &F
))+Cq!//1##%&'*su- - -r!   )platformnumpyr   
matplotlibrs   matplotlib.colorsr   matplotlib.testing.decoratorsr   matplotlib.pyplotpyplotr   mpl_toolkits.mplot3dr   r    r.   machiner@   r\   rd   r   r   r    r!   r   <module>r      s       ( :  & $%4wG H #$$gF. G. ;-T/x//1W<e!EIEI:(I1:,
-r!   