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


Python Locator.set_axis方法代码示例

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


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

示例1: get_locator

# 需要导入模块: from matplotlib.ticker import Locator [as 别名]
# 或者: from matplotlib.ticker.Locator import set_axis [as 别名]
def get_locator(self, dmin, dmax):
        'Pick the best locator based on a distance.'
        _check_implicitly_registered()
        delta = relativedelta(dmax, dmin)

        num_days = (delta.years * 12.0 + delta.months) * 31.0 + delta.days
        num_sec = (delta.hours * 60.0 + delta.minutes) * 60.0 + delta.seconds
        tot_sec = num_days * 86400. + num_sec

        if abs(tot_sec) < self.minticks:
            self._freq = -1
            locator = MilliSecondLocator(self.tz)
            locator.set_axis(self.axis)

            locator.set_view_interval(*self.axis.get_view_interval())
            locator.set_data_interval(*self.axis.get_data_interval())
            return locator

        return dates.AutoDateLocator.get_locator(self, dmin, dmax) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:21,代码来源:_converter.py

示例2: __call__

# 需要导入模块: from matplotlib.ticker import Locator [as 别名]
# 或者: from matplotlib.ticker.Locator import set_axis [as 别名]
def __call__(self):
        'Return the locations of the ticks.'
        # axis calls Locator.set_axis inside set_m<xxxx>_formatter
        _check_implicitly_registered()

        vi = tuple(self.axis.get_view_interval())
        if vi != self.plot_obj.view_interval:
            self.plot_obj.date_axis_info = None
        self.plot_obj.view_interval = vi
        vmin, vmax = vi
        if vmax < vmin:
            vmin, vmax = vmax, vmin
        if self.isdynamic:
            locs = self._get_default_locs(vmin, vmax)
        else:  # pragma: no cover
            base = self.base
            (d, m) = divmod(vmin, base)
            vmin = (d + 1) * base
            locs = lrange(vmin, vmax + 1, base)
        return locs 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:22,代码来源:_converter.py

示例3: get_locator

# 需要导入模块: from matplotlib.ticker import Locator [as 别名]
# 或者: from matplotlib.ticker.Locator import set_axis [as 别名]
def get_locator(self, dmin, dmax):
        'Pick the best locator based on a distance.'
        delta = relativedelta(dmax, dmin)

        num_days = ((delta.years * 12.0) + delta.months * 31.0) + delta.days
        num_sec = (delta.hours * 60.0 + delta.minutes) * 60.0 + delta.seconds
        tot_sec = num_days * 86400. + num_sec

        if abs(tot_sec) < self.minticks:
            self._freq = -1
            locator = MilliSecondLocator(self.tz)
            locator.set_axis(self.axis)

            locator.set_view_interval(*self.axis.get_view_interval())
            locator.set_data_interval(*self.axis.get_data_interval())
            return locator

        return dates.AutoDateLocator.get_locator(self, dmin, dmax) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:20,代码来源:converter.py

示例4: __call__

# 需要导入模块: from matplotlib.ticker import Locator [as 别名]
# 或者: from matplotlib.ticker.Locator import set_axis [as 别名]
def __call__(self):
        'Return the locations of the ticks.'
        # axis calls Locator.set_axis inside set_m<xxxx>_formatter
        vi = tuple(self.axis.get_view_interval())
        if vi != self.plot_obj.view_interval:
            self.plot_obj.date_axis_info = None
        self.plot_obj.view_interval = vi
        vmin, vmax = vi
        if vmax < vmin:
            vmin, vmax = vmax, vmin
        if self.isdynamic:
            locs = self._get_default_locs(vmin, vmax)
        else:  # pragma: no cover
            base = self.base
            (d, m) = divmod(vmin, base)
            vmin = (d + 1) * base
            locs = lrange(vmin, vmax + 1, base)
        return locs 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:20,代码来源:converter.py

示例5: get_locator

# 需要导入模块: from matplotlib.ticker import Locator [as 别名]
# 或者: from matplotlib.ticker.Locator import set_axis [as 别名]
def get_locator(self, dmin, dmax):
        'Pick the best locator based on a distance.'
        delta = relativedelta(dmax, dmin)

        num_days = (delta.years * 12.0 + delta.months) * 31.0 + delta.days
        num_sec = (delta.hours * 60.0 + delta.minutes) * 60.0 + delta.seconds
        tot_sec = num_days * 86400. + num_sec

        if abs(tot_sec) < self.minticks:
            self._freq = -1
            locator = MilliSecondLocator(self.tz)
            locator.set_axis(self.axis)

            locator.set_view_interval(*self.axis.get_view_interval())
            locator.set_data_interval(*self.axis.get_data_interval())
            return locator

        return dates.AutoDateLocator.get_locator(self, dmin, dmax) 
开发者ID:securityclippy,项目名称:elasticintel,代码行数:20,代码来源:_converter.py


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