
    zYHh1                     L    d Z ddlZddlmZ dgZ G d dej                        Zy)z2StrConverter module containing class StrConverter.    NStrConverterc                   @    e Zd ZdZed        Zed        Zed        Zy)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                      y )N )unitaxiss     b/var/www/html/planif/env/lib/python3.12/site-packages/matplotlib/testing/jpl_units/StrConverter.pyaxisinfozStrConverter.axisinfo   s         c                    | g k(  rg S |j                   }||j                  u rd}nd}|j                          |j                         }|j	                         }|D cg c]#  }|j                         s|j                         % }}|sg }g }t        j                  |       s| g} g }| D ]  }	|	|vs|	|vs|j                  |	        |j                  |       dg|z   dgz   }t        t        t        |                  }d|d<   |d   dz
  |d<   |j                  |       |j                  |       |j                         }
|
j!                  |d   |d          |r|j#                  |d   |d          n|j%                  |d   |d          | D 	cg c]  }	||j'                  |	          }}	|j(                  j+                  d       |S c c}w c c}	w )NTF g      ?r   )axesxaxisget_major_ticksget_ticklocsget_ticklabelsget_textnpiterableappendextendlistrangelen	set_ticksset_ticklabelsget_major_locator
set_boundsset_xlimset_ylimindexviewLimignore)valuer   r   axisXAxistickslabelsl	newValuesvlocresults               r	   convertzStrConverter.convert   s    B;I YY288GG!!#$$&(.?1!**,!**,??EF{{5!GE	 	$A1I#5  #	$ 	i  "%U3v;'(a"IOb	uF#$$&uQxr+KKa%),KKa%),278Q%Q(88


"_ @X 9s   G
1G
Gc                      y)Nindexedr   )r%   r   s     r	   default_unitszStrConverter.default_units]   s     r   N)__name__
__module____qualname____doc__staticmethodr
   r/   r2   r   r   r	   r   r   
   sF       @ @D  r   )r6   numpyr   matplotlib.unitsunits__all__ConversionInterfacer   r   r   r	   <module>r=      s*    8   
W5,, Wr   