當前位置: 首頁>>代碼示例>>Python>>正文


Python patches.bbox_artist方法代碼示例

本文整理匯總了Python中matplotlib.patches.bbox_artist方法的典型用法代碼示例。如果您正苦於以下問題:Python patches.bbox_artist方法的具體用法?Python patches.bbox_artist怎麽用?Python patches.bbox_artist使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在matplotlib.patches的用法示例。


在下文中一共展示了patches.bbox_artist方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: draw

# 需要導入模塊: from matplotlib import patches [as 別名]
# 或者: from matplotlib.patches import bbox_artist [as 別名]
def draw(self, renderer, *args, **kwargs):
        'Draw the axis lines, grid lines, tick lines and labels'

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

        ticks_to_draw = self._update_ticks(renderer)
        ticklabelBoxes, ticklabelBoxes2 = self._get_tick_bboxes(ticks_to_draw,
                                                                renderer)

        for tick in ticks_to_draw:
            tick.draw(renderer)

        # 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)

        if 0:  # draw the bounding boxes around the text for debug
            for tick in self.majorTicks:
                label = tick.label1
                mpatches.bbox_artist(label, renderer)
            mpatches.bbox_artist(self.label, renderer)

        renderer.close_group(__name__) 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:36,代碼來源:axis.py

示例2: draw

# 需要導入模塊: from matplotlib import patches [as 別名]
# 或者: from matplotlib.patches import bbox_artist [as 別名]
def draw(self, renderer, *args, **kwargs):
        'Draw the axis lines, grid lines, tick lines and labels'

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

        ticks_to_draw = self._update_ticks(renderer)
        ticklabelBoxes, ticklabelBoxes2 = self._get_tick_bboxes(ticks_to_draw,
                                                                renderer)

        for tick in ticks_to_draw:
            tick.draw(renderer)

        # 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(renderer)

        self.label.draw(renderer)

        self._update_offset_text_position(ticklabelBoxes, ticklabelBoxes2)
        self.offsetText.set_text(self.major.formatter.get_offset())
        self.offsetText.draw(renderer)

        if 0:  # draw the bounding boxes around the text for debug
            for tick in self.majorTicks:
                label = tick.label1
                mpatches.bbox_artist(label, renderer)
            mpatches.bbox_artist(self.label, renderer)

        renderer.close_group(__name__)
        self.stale = False 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:37,代碼來源:axis.py


注:本文中的matplotlib.patches.bbox_artist方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。