本文整理匯總了Python中matplotlib.backend_managers方法的典型用法代碼示例。如果您正苦於以下問題:Python matplotlib.backend_managers方法的具體用法?Python matplotlib.backend_managers怎麽用?Python matplotlib.backend_managers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類matplotlib
的用法示例。
在下文中一共展示了matplotlib.backend_managers方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: set_function
# 需要導入模塊: import matplotlib [as 別名]
# 或者: from matplotlib import backend_managers [as 別名]
def set_function(self, string):
self.SetStatusText("%s" % string, 1)
# tools for matplotlib.backend_managers.ToolManager:
示例2: set_function
# 需要導入模塊: import matplotlib [as 別名]
# 或者: from matplotlib import backend_managers [as 別名]
def set_function(self, string):
self.SetStatusText("%s" % string, 1)
# def set_measurement(self, string):
# self.SetStatusText("Measurement: %s" % string, 2)
# tools for matplotlib.backend_managers.ToolManager:
示例3: init_toolmanager
# 需要導入模塊: import matplotlib [as 別名]
# 或者: from matplotlib import backend_managers [as 別名]
def init_toolmanager(self):
self.toolmanager = matplotlib.backend_managers.ToolManager(self.canvas.figure)
self.toolmanager.add_tool('viewpos', 'ToolViewsPositions') # required for pan/zoom/home/back/forward
self.toolmanager.add_tool('pan', 'ToolPan') # pan w. mouse and zoom w. wheel with 'p' key
self.toolmanager.add_tool('zoom', 'ToolZoom') # zoom to rect with 'o' key
self.toolmanager.add_tool('home', 'ToolHome') # 'h', 'r', 'home'
if hasattr(matplotlib.backend_managers, "ToolHelp"):
self.toolmanager.add_tool('help', 'ToolHelp') # 'F1'
self.toolmanager.add_tool('back', 'ToolBack') # 'left', 'c', 'backspace'
self.toolmanager.add_tool('forward', 'ToolForward') # 'right', 'v'
self.toolmanager.add_tool('save', 'ToolSaveFigure') # 's', 'ctrl+s'
self.toolmanager.add_tool('grid', 'ToolGrid') # toggle throug major h/v grids with 'g' key
self.toolmanager.add_tool('grid_minor', 'ToolMinorGrid') # toggle throug major/minor grids with 'G' key
self.toolmanager.add_tool('yscale', 'ToolYScale') # toggle lin/log scaling with 'l' key
self.toolmanager.add_tool('xscale', 'ToolXScale') # toggle lin/log scaling with 'k','L' keys
# some tools will only be available with matplotlib 3.0:
if hasattr(matplotlib.backend_managers, "ToolCopyToClipboard"):
self.toolmanager.add_tool('copy', 'ToolCopyToClipboard')
self.toolmanager.add_tool('rubberband', 'ToolRubberband')
self.toolmanager.add_tool('setcursor', 'ToolSetCursor')
self.toolmanager.toolmanager_connect("tool_trigger_home", self.set_history_buttons)
self.toolmanager.toolmanager_connect("tool_trigger_back", self.set_history_buttons)
self.toolmanager.toolmanager_connect("tool_trigger_forward", self.set_history_buttons)