KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache
System : Linux server112.speedpacket.com 3.10.0-962.3.2.lve1.5.36.el7.x86_64 #1 SMP Mon May 18 02:16:06 EDT 2020 x86_64
User : equistyl ( 1341)
PHP Version : 8.1.30
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/matplotlib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/matplotlib/units.pyo
�
r`]c@s�dZddlmZddlZddlmZmZmZddd��YZ	ddd��YZ
d	efd
��YZe�Z
dS(
sQ
The classes here provide support for using custom classes with
matplotlib, eg those that do not expose the array interface but know
how to converter themselves to arrays.  It also supoprts classes with
units and units conversion.  Use cases include converters for custom
objects, eg a list of datetime objects, as well as for objects that
are unit aware.  We don't assume any particular units implementation,
rather a units implementation must provide a ConversionInterface, and
the register with the Registry converter dictionary.  For example,
here is a complete implementation which supports plotting with native
datetime objects::


    import matplotlib.units as units
    import matplotlib.dates as dates
    import matplotlib.ticker as ticker
    import datetime

    class DateConverter(units.ConversionInterface):

        @staticmethod
        def convert(value, unit, axis):
            'convert value to a scalar or array'
            return dates.date2num(value)

        @staticmethod
        def axisinfo(unit, axis):
            'return major and minor tick locators and formatters'
            if unit!='date': return None
            majloc = dates.AutoDateLocator()
            majfmt = dates.AutoDateFormatter(majloc)
            return AxisInfo(majloc=majloc,
                            majfmt=majfmt,
                            label='date')

        @staticmethod
        def default_units(x, axis):
            'return the default unit for x or None'
            return 'date'

    # finally we register our object type with a converter
    units.registry[datetime.date] = DateConverter()

i����(tprint_functionN(titerablet
is_numliketis_string_liketAxisInfocBs)eZdZddddddd�ZRS(sRinformation to support default axis labeling and tick labeling, and default limitscCs:||_||_||_||_||_||_dS(sW
        majloc and minloc: TickLocators for the major and minor ticks
        majfmt and minfmt: TickFormatters for the major and minor ticks
        label: the default axis label
        default_limits: the default min, max of the axis if no data is present
        If any of the above are None, the axis will simply use the default
        N(tmajloctminloctmajfmttminfmttlabeltdefault_limits(tselfRRRRR	R
((s6/usr/lib64/python2.7/site-packages/matplotlib/units.pyt__init__3s
					N(t__name__t
__module__t__doc__tNoneR(((s6/usr/lib64/python2.7/site-packages/matplotlib/units.pyR1s	tConversionInterfacecBsJeZdZed��Zed��Zed��Zed��ZRS(s�
    The minimal interface for a converter to take custom instances (or
    sequences) and convert them to values mpl can use
    cCsdS(sCreturn an units.AxisInfo instance for axis with the specified unitsN(R(tunittaxis((s6/usr/lib64/python2.7/site-packages/matplotlib/units.pytaxisinfoJscCsdS(s8return the default unit for x or None for the given axisN(R(txR((s6/usr/lib64/python2.7/site-packages/matplotlib/units.pyt
default_unitsOscCs|S(s�
        convert obj using unit for the specified axis.  If obj is a sequence,
        return the converted sequence.  The ouput must be a sequence of scalars
        that can be used by the numpy array layer
        ((tobjRR((s6/usr/lib64/python2.7/site-packages/matplotlib/units.pytconvertTscCs5t|�r'x"|D]
}t|�SWn
t|�SdS(s�
        The matplotlib datalim, autoscaling, locators etc work with
        scalars which are the units converted to floats given the
        current unit.  The converter may be passed these floats, or
        arrays of them, even when units are set.  Derived conversion
        interfaces may opt to pass plain-ol unitless numbers through
        the conversion interface and this is a helper function for
        them.
        N(RR(Rtthisx((s6/usr/lib64/python2.7/site-packages/matplotlib/units.pyR]s
(R
RRtstaticmethodRRRR(((s6/usr/lib64/python2.7/site-packages/matplotlib/units.pyREs
	tRegistrycBs eZdZd�Zd�ZRS(s2
    register types with conversion interface
    cCstj|�i|_dS(N(tdictRt_cached(R((s6/usr/lib64/python2.7/site-packages/matplotlib/units.pyRrs
cCs�t|�sdSd}t|dd�}|dk	rF|j|�}n|dkr�t|�r�xB|D]7}|re|t|dd�kre|j|�}|SqeWn|S(s3get the converter interface instance for x, or Nonet	__class__N(tlenRtgetattrtgetRt
get_converter(RRt	convertertclassxR((s6/usr/lib64/python2.7/site-packages/matplotlib/units.pyR"vs
(R
RRRR"(((s6/usr/lib64/python2.7/site-packages/matplotlib/units.pyRns	(((Rt
__future__Rtnumpytnptmatplotlib.cbookRRRRRRRtregistry(((s6/usr/lib64/python2.7/site-packages/matplotlib/units.pyt<module>,s)#

Anon7 - 2021