本文整理匯總了Python中matplotlib.cbook.Stack方法的典型用法代碼示例。如果您正苦於以下問題:Python cbook.Stack方法的具體用法?Python cbook.Stack怎麽用?Python cbook.Stack使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類matplotlib.cbook
的用法示例。
在下文中一共展示了cbook.Stack方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from matplotlib import cbook [as 別名]
# 或者: from matplotlib.cbook import Stack [as 別名]
def __init__(self, canvas):
self.canvas = canvas
canvas.toolbar = self
# a dict from axes index to a list of view limits
self._views = cbook.Stack()
self._positions = cbook.Stack() # stack of subplot positions
self._xypress = None # the location and axis info at the time
# of the press
self._idPress = None
self._idRelease = None
self._active = None
self._lastCursor = None
self._init_toolbar()
self._idDrag = self.canvas.mpl_connect(
'motion_notify_event', self.mouse_move)
self._ids_zoom = []
self._zoom_mode = None
self._button_pressed = None # determined by the button pressed
# at start
self.mode = '' # a mode string for the status bar
self.set_history_buttons()
示例2: add_figure
# 需要導入模塊: from matplotlib import cbook [as 別名]
# 或者: from matplotlib.cbook import Stack [as 別名]
def add_figure(self, figure):
"""Add the current figure to the stack of views and positions"""
if figure not in self.views:
self.views[figure] = cbook.Stack()
self.positions[figure] = cbook.Stack()
self.home_views[figure] = WeakKeyDictionary()
# Define Home
self.push_current(figure)
# Make sure we add a home view for new axes as they're added
figure.add_axobserver(lambda fig: self.update_home_views(fig))