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


Python units.AxisInfo方法代码示例

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


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

示例1: axisinfo

# 需要导入模块: from matplotlib import units [as 别名]
# 或者: from matplotlib.units import AxisInfo [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 = PandasAutoDateLocator(tz=tz)
        majfmt = PandasAutoDateFormatter(majloc, tz=tz)
        datemin = pydt.date(2000, 1, 1)
        datemax = pydt.date(2010, 1, 1)

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

示例2: axisinfo

# 需要导入模块: from matplotlib import units [as 别名]
# 或者: from matplotlib.units import AxisInfo [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

示例3: axisinfo

# 需要导入模块: from matplotlib import units [as 别名]
# 或者: from matplotlib.units import AxisInfo [as 别名]
def axisinfo(unit, axis):
        """Sets the default axis ticks and labels

        Parameters
        ----------
        unit : `.UnitData`
            object string unit information for value
        axis : `~matplotlib.Axis.axis`
            axis for which information is being set

        Returns
        -------
        axisinfo : `~matplotlib.units.AxisInfo`
            Information to support default tick labeling

        .. note: axis is not used
        """
        # locator and formatter take mapping dict because
        # args need to be pass by reference for updates
        majloc = StrCategoryLocator(unit._mapping)
        majfmt = StrCategoryFormatter(unit._mapping)
        return units.AxisInfo(majloc=majloc, majfmt=majfmt) 
开发者ID:PacktPublishing,项目名称:Mastering-Elasticsearch-7.0,代码行数:24,代码来源:category.py

示例4: axisinfo

# 需要导入模块: from matplotlib import units [as 别名]
# 或者: from matplotlib.units import AxisInfo [as 别名]
def axisinfo( unit, axis ):
      """: Returns information on how to handle an axis that has Epoch data.

      = INPUT VARIABLES
      - unit    The units to use for a axis with Epoch data.

      = RETURN VALUE
      - Returns a matplotlib AxisInfo data structure that contains
        minor/major formatters, major/minor locators, and default
        label information.
      """

      majloc = date_ticker.AutoDateLocator()
      majfmt = date_ticker.AutoDateFormatter( majloc )

      return units.AxisInfo( majloc = majloc,
                             majfmt = majfmt,
                             label = unit )

   #------------------------------------------------------------------------ 
开发者ID:Solid-Mechanics,项目名称:matplotlib-4-abaqus,代码行数:22,代码来源:EpochConverter.py

示例5: axisinfo

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

        *unit* is a tzinfo instance or None.
        The *axis* argument is required but not used.
        """
        calendar, date_unit, date_type = unit

        majloc = NetCDFTimeDateLocator(4, calendar=calendar,
                                       date_unit=date_unit)
        majfmt = NetCDFTimeDateFormatter(majloc, calendar=calendar,
                                         time_units=date_unit)
        if date_type is CalendarDateTime:
            datemin = CalendarDateTime(cftime.datetime(2000, 1, 1),
                                       calendar=calendar)
            datemax = CalendarDateTime(cftime.datetime(2010, 1, 1),
                                       calendar=calendar)
        else:
            datemin = date_type(2000, 1, 1)
            datemax = date_type(2010, 1, 1)
        return munits.AxisInfo(majloc=majloc, majfmt=majfmt, label='',
                               default_limits=(datemin, datemax)) 
开发者ID:SciTools,项目名称:nc-time-axis,代码行数:25,代码来源:__init__.py

示例6: axisinfo

# 需要导入模块: from matplotlib import units [as 别名]
# 或者: from matplotlib.units import AxisInfo [as 别名]
def axisinfo(unit, axis):
        """Sets the default axis ticks and labels

        Parameters
        ---------
        unit : :class:`.UnitData`
            object string unit information for value
        axis : :class:`~matplotlib.Axis.axis`
            axis for which information is being set

        Returns
        -------
        :class:~matplotlib.units.AxisInfo~
            Information to support default tick labeling

        .. note: axis is not used
        """
        # locator and formatter take mapping dict because
        # args need to be pass by reference for updates
        majloc = StrCategoryLocator(unit._mapping)
        majfmt = StrCategoryFormatter(unit._mapping)
        return units.AxisInfo(majloc=majloc, majfmt=majfmt) 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:24,代码来源:category.py

示例7: axisinfo

# 需要导入模块: from matplotlib import units [as 别名]
# 或者: from matplotlib.units import AxisInfo [as 别名]
def axisinfo(unit, axis):
        """: Returns information on how to handle an axis that has Epoch data.

        = INPUT VARIABLES
        - unit     The units to use for a axis with Epoch data.

        = RETURN VALUE
        - Returns a matplotlib AxisInfo data structure that contains
          minor/major formatters, major/minor locators, and default
          label information.
        """

        majloc = date_ticker.AutoDateLocator()
        majfmt = date_ticker.AutoDateFormatter(majloc)

        return units.AxisInfo(majloc=majloc, majfmt=majfmt, label=unit)

    # ----------------------------------------------------------------------- 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:20,代码来源:EpochConverter.py

示例8: axisinfo

# 需要导入模块: from matplotlib import units [as 别名]
# 或者: from matplotlib.units import AxisInfo [as 别名]
def axisinfo(unit, axis):
        'return AxisInfo instance for x and unit'

        if unit == radians:
            return units.AxisInfo(
                majloc=ticker.MultipleLocator(base=np.pi/2),
                majfmt=ticker.FuncFormatter(rad_fn),
                label=unit.fullname,
            )
        elif unit == degrees:
            return units.AxisInfo(
                majloc=ticker.AutoLocator(),
                majfmt=ticker.FormatStrFormatter(r'$%i^\circ$'),
                label=unit.fullname,
            )
        elif unit is not None:
            if hasattr(unit, 'fullname'):
                return units.AxisInfo(label=unit.fullname)
            elif hasattr(unit, 'unit'):
                return units.AxisInfo(label=unit.unit.fullname)
        return None 
开发者ID:holzschu,项目名称:python3_ios,代码行数:23,代码来源:basic_units.py


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