B
    }d!                 @   s$   d Z ddlmZ G dd deZdS )z Support for plotting with units
    )LatexInlinec                   s(   e Zd ZdZdZe fddZ  ZS )LatexInlineDimensionala  Custom LaTeX formatter that includes physical type (if available)

    Mainly for auto-labelling `Axes` in matplotlib figures.

    Examples
    --------
    The built-in astropy ``latex_inline`` formatter gives this:

    >>> Unit('m/s').to_string(format='latex_inline')
    '$\mathrm{m\,s^{-1}}$'

    This custom 'dimensional' formatter gives:

    >>> Unit('m/s').to_string(format='latex_inline_dimensional')
    'Speed [$\mathrm{m\,s^{-1}}$]'
    Zlatex_inline_dimensionalc                sN   dt  j|f|| d}|jdkrJt|j dd}| d| S |S )N[]>   dimensionlessunknownN_z\_ )super	to_stringZphysical_typestrtitlereplace)clsunitargskwargsuptype)	__class__ \/work/yifan.wang/ringdown/master-ringdown-env/lib/python3.7/site-packages/gwpy/plot/units.pyr   -   s
    
z LatexInlineDimensional.to_string)__name__
__module____qualname____doc__nameclassmethodr   __classcell__r   r   )r   r   r      s   r   N)r   Zastropy.units.formatr   r   r   r   r   r   <module>   s   