• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python transforms.interval_contains函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中matplotlib.transforms.interval_contains函数的典型用法代码示例。如果您正苦于以下问题:Python interval_contains函数的具体用法?Python interval_contains怎么用?Python interval_contains使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: draw

    def draw(self, renderer):
        if not self.get_visible():
            return
        renderer.open_group(self.__name__)

        lower_interval = self.axes.xaxis.lower_interval
        upper_interval = self.axes.xaxis.upper_interval

        if self.gridOn and transforms.interval_contains(
                self.axes.xaxis.get_view_interval(), self.get_loc()):
            self.gridline.draw(renderer)

        if transforms.interval_contains(lower_interval, self.get_loc()):
            if self.tick1On:
                self.tick1line.draw(renderer)
            if self.label1On:
                self.label1.draw(renderer)

        if transforms.interval_contains(upper_interval, self.get_loc()):
            if self.tick2On:
                self.tick2line.draw(renderer)
            if self.label2On:
                self.label2.draw(renderer)

        renderer.close_group(self.__name__)
开发者ID:Kojoley,项目名称:matplotlib,代码行数:25,代码来源:skewt.py


示例2: draw

    def draw(self, renderer, *args, **kwargs):
        'Draw the axis lines, grid lines, tick lines and labels'
        ticklabelBoxes = []
        ticklabelBoxes2 = []

        if not self.get_visible(): return
        renderer.open_group(__name__)
        interval = self.get_view_interval()
        for tick, loc, label in self.iter_ticks():
            if tick is None: continue
            if transforms.interval_contains(interval, loc):
                tick.set_label1(label)
                tick.set_label2(label)
            tick.update_position(loc)
            tick.draw(renderer)
            if tick.label1On and tick.label1.get_visible():
                extent = tick.label1.get_window_extent(renderer)
                ticklabelBoxes.append(extent)
            if tick.label2On and tick.label2.get_visible():
                extent = tick.label2.get_window_extent(renderer)
                ticklabelBoxes2.append(extent)

        # scale up the axis label box to also find the neighbors, not
        # just the tick labels that actually overlap note we need a
        # *copy* of the axis label box because we don't wan't to scale
        # the actual bbox

        self._update_label_position(ticklabelBoxes, ticklabelBoxes2)

        self.label.draw(renderer)

        self._update_offset_text_position(ticklabelBoxes, ticklabelBoxes2)
        self.offsetText.set_text( self.major.formatter.get_offset() )
        self.offsetText.draw(renderer)
开发者ID:brodyfuchs,项目名称:EnvAnalysis,代码行数:34,代码来源:SkewT.py


示例3: get_major_ticks_within_view_interval

def get_major_ticks_within_view_interval(axis):
    interval = axis.get_view_interval()
    ticks_in_view_interval = []
    for tick, loc in zip(axis.get_major_ticks(),
                         axis.get_major_locator()()):
        if mtransforms.interval_contains(interval, loc):
            ticks_in_view_interval.append(tick)
    return ticks_in_view_interval
开发者ID:ebothmann,项目名称:heppyplot,代码行数:8,代码来源:plot_helpers.py


示例4: draw

 def draw(self, renderer):
     with ExitStack() as stack:
         for artist in [self.gridline, self.tick1line, self.tick2line,
                        self.label1, self.label2]:
             stack.callback(artist.set_visible, artist.get_visible())
         needs_lower = transforms.interval_contains(
             self.axes.lower_xlim, self.get_loc())
         needs_upper = transforms.interval_contains(
             self.axes.upper_xlim, self.get_loc())
         self.tick1line.set_visible(
             self.tick1line.get_visible() and needs_lower)
         self.label1.set_visible(
             self.label1.get_visible() and needs_lower)
         self.tick2line.set_visible(
             self.tick2line.get_visible() and needs_upper)
         self.label2.set_visible(
             self.label2.get_visible() and needs_upper)
         super(SkewXTick, self).draw(renderer)
开发者ID:HubertHolin,项目名称:matplotlib,代码行数:18,代码来源:test_skew.py


示例5: get_major_ticks_within_view_interval

def get_major_ticks_within_view_interval(axis): 
    """ Function shamelessly taken from:
            http://www.nabble.com/eliminating-the-top-tick-on-an-axis-to19446256.html#a19446256

        but the return now is the locations, not the ticks
        which seems to work better with AxesGrids.
    """
    interval = axis.get_view_interval() 

    locs = [] 
    for tick, loc in zip(axis.get_major_ticks(), 
                         axis.get_major_locator()()): 
        if mtransforms.interval_contains(interval, loc): 
            locs.append(loc) 
    return locs
开发者ID:jimmyliao13536,项目名称:PhD-python,代码行数:15,代码来源:plotting.py


示例6: gridOn

 def gridOn(self):
     return (self._gridOn and (self._has_default_loc() or
             transforms.interval_contains(self.get_view_interval(),
                                          self.get_loc())))
开发者ID:DanHickstein,项目名称:matplotlib,代码行数:4,代码来源:skewt.py


示例7: _need_upper

 def _need_upper(self):
     return (self._has_default_loc() or
             transforms.interval_contains(self.axes.upper_xlim,
                                          self.get_loc()))
开发者ID:DanHickstein,项目名称:matplotlib,代码行数:4,代码来源:skewt.py


示例8: gridOn

 def gridOn(self):  # noqa: N802
     """Control whether the gridline is drawn for this tick."""
     return (self._gridOn and (self._has_default_loc()
             or transforms.interval_contains(self.get_view_interval(), self.get_loc())))
开发者ID:akrherz,项目名称:MetPy,代码行数:4,代码来源:skewt.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python transforms.nonsingular函数代码示例发布时间:2022-05-27
下一篇:
Python transforms.blended_transform_factory函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap