本文整理汇总了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)