
    P/Ph1                     J    d Z ddlZddlmZ dgZ G d dej                  ZdS )z2StrConverter module containing class StrConverter.    NStrConverterc                   T    e Zd ZdZed             Zed             Zed             ZdS )r   al  
    A Matplotlib converter class for string data values.

    Valid units for string are:
    - 'indexed' : Values are indexed as they are specified for plotting.
    - 'sorted'  : Values are sorted alphanumerically.
    - 'inverted' : Values are inverted so that the first value is on top.
    - 'sorted-inverted' :  A combination of 'sorted' and 'inverted'
    c                     d S )N )unitaxiss     i/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/matplotlib/testing/jpl_units/StrConverter.pyaxisinfozStrConverter.axisinfo   s	     t    c                   	
 | g k    rg S |j         }||j        u rd}nd}|                                 |                                
|                                	d 	D             		sg 
g 	t          j        |           s| g} g }| D ]}|	vr||vr|                    |            	                    |           dg	z   dgz   	t          t          t          	                              
d
d<   
d         dz
  
d<   |                    
           |                    	           |                                }|                    
d         
d                    |r#|                    
d         
d                    n"|                    
d         
d                    	
fd| D             }|j                            d           |S )	NTFc                 ^    g | ]*}|                                 |                                 +S r   )get_text).0ls     r	   
<listcomp>z(StrConverter.convert.<locals>.<listcomp>,   s-    ???1!**,,?!**,,???r    g      ?r   c                 F    g | ]}                     |                   S r   )index)r   vlabelstickss     r	   r   z(StrConverter.convert.<locals>.<listcomp>X   s(    888Q%Q(888r   )axesxaxisget_major_ticksget_ticklocsget_ticklabelsnpiterableappendextendlistrangelen	set_ticksset_ticklabelsget_major_locator
set_boundsset_xlimset_ylimviewLimignore)valuer   r   axisXAxis	newValuesr   locresultr   r   s            @@r	   convertzStrConverter.convert   s    B;;I Y28GGG!!##$$&&????? 	EF{5!! 	GE	 	$ 	$A1I#5#5  ###i    "%U3v;;''((a"IOb	uF###$$&&uQxr+++ 	-KKa%),,,,KKa%),,,88888%888

"r   c                     dS )Nindexedr   )r-   r   s     r	   default_unitszStrConverter.default_units]   s	     yr   N)__name__
__module____qualname____doc__staticmethodr
   r3   r6   r   r   r	   r   r   
   ss            \ @ @ \@D   \  r   )r:   numpyr   matplotlib.unitsunits__all__ConversionInterfacer   r   r   r	   <module>rA      sr    8 8                
W W W W W5, W W W W Wr   