o
    Ci1                     @   s4   d Z ddlZddlmZ dgZG dd dejZdS )z2StrConverter module containing class StrConverter.    NStrConverterc                   @   s4   e Zd ZdZedd Zedd Zed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                 C   s   d S )N )unitaxisr   r   f/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/StrConverter.pyaxisinfo   s   zStrConverter.axisinfoc           	         sT  | g krg S |j }||ju rd}nd}|  | |  dd  D   s,g g  t| s4| g} g }| D ]}| vrG||vrG|| q8 | dg  dg  t	t
t dd< d d d< | |  | }|d d  |r|d d  n
|d d   fd	d| D }|jd |S )
NTFc                 S   s   g | ]
}|  r|  qS r   )get_text).0lr   r   r   
<listcomp>,   s    z(StrConverter.convert.<locals>.<listcomp> g      ?r   c                    s   g | ]	}  | qS r   )index)r	   vlabelsticksr   r   r   X   s    )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   r   convert   sF   





zStrConverter.convertc                 C   s   dS )Nindexedr   )r'   r   r   r   r   default_units]   s   zStrConverter.default_unitsN)__name__
__module____qualname____doc__staticmethodr   r-   r/   r   r   r   r   r   
   s    


B)r3   numpyr   matplotlib.unitsunits__all__ConversionInterfacer   r   r   r   r   <module>   s
    