當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。