当前位置: 首页>>代码示例>>Python>>正文


Python matplotlib.units方法代码示例

本文整理汇总了Python中matplotlib.units方法的典型用法代码示例。如果您正苦于以下问题:Python matplotlib.units方法的具体用法?Python matplotlib.units怎么用?Python matplotlib.units使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在matplotlib的用法示例。


在下文中一共展示了matplotlib.units方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: axisinfo

# 需要导入模块: import matplotlib [as 别名]
# 或者: from matplotlib import units [as 别名]
def axisinfo(unit, axis):
        """
        Return the :class:`~matplotlib.units.AxisInfo` for *unit*.

        *unit* is a tzinfo instance or None.
        The *axis* argument is required but not used.
        """
        tz = unit

        majloc = AutoDateLocator(tz=tz)
        majfmt = AutoDateFormatter(majloc, tz=tz)
        datemin = datetime.date(2000, 1, 1)
        datemax = datetime.date(2010, 1, 1)

        return units.AxisInfo(majloc=majloc, majfmt=majfmt, label='',
                              default_limits=(datemin, datemax)) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:18,代码来源:dates.py

示例2: _get_interval

# 需要导入模块: import matplotlib [as 别名]
# 或者: from matplotlib import units [as 别名]
def _get_interval(self):
        """
        Return the number of units for each tick.
        """
        return 1 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:7,代码来源:dates.py

示例3: convert

# 需要导入模块: import matplotlib [as 别名]
# 或者: from matplotlib import units [as 别名]
def convert(value, unit, axis):
        """
        If *value* is not already a number or sequence of numbers,
        convert it with :func:`date2num`.

        The *unit* and *axis* arguments are not used.
        """
        if units.ConversionInterface.is_numlike(value):
            return value
        return date2num(value) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:12,代码来源:dates.py

示例4: setup_class

# 需要导入模块: import matplotlib [as 别名]
# 或者: from matplotlib import units [as 别名]
def setup_class(cls):
        cls.original_units_registry = matplotlib.units.registry.copy() 
开发者ID:Solid-Mechanics,项目名称:matplotlib-4-abaqus,代码行数:4,代码来源:decorators.py

示例5: datalim_to_dt

# 需要导入模块: import matplotlib [as 别名]
# 或者: from matplotlib import units [as 别名]
def datalim_to_dt(self):
        """
        Convert axis data interval to datetime objects.
        """
        dmin, dmax = self.axis.get_data_interval()
        if dmin > dmax:
            dmin, dmax = dmax, dmin
        if dmin < 1:
            raise ValueError('datalim minimum {} is less than 1 and '
                             'is an invalid Matplotlib date value. This often '
                             'happens if you pass a non-datetime '
                             'value to an axis that has datetime units'
                             .format(dmin))
        return num2date(dmin, self.tz), num2date(dmax, self.tz) 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:16,代码来源:dates.py

示例6: viewlim_to_dt

# 需要导入模块: import matplotlib [as 别名]
# 或者: from matplotlib import units [as 别名]
def viewlim_to_dt(self):
        """
        Converts the view interval to datetime objects.
        """
        vmin, vmax = self.axis.get_view_interval()
        if vmin > vmax:
            vmin, vmax = vmax, vmin
        if vmin < 1:
            raise ValueError('view limit minimum {} is less than 1 and '
                             'is an invalid Matplotlib date value. This '
                             'often happens if you pass a non-datetime '
                             'value to an axis that has datetime units'
                             .format(vmin))
        return num2date(vmin, self.tz), num2date(vmax, self.tz) 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:16,代码来源:dates.py

示例7: units

# 需要导入模块: import matplotlib [as 别名]
# 或者: from matplotlib import units [as 别名]
def units(self):
        if self._units is None:
            try:
                from astropy import units

                self.log
            except ImportError:
                units = NotAModule(self._name)
            self._units = units
        return self._units 
开发者ID:yt-project,项目名称:unyt,代码行数:12,代码来源:_on_demand_imports.py


注:本文中的matplotlib.units方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。