本文整理汇总了Python中matplotlib.backends.backend_wx._load_bitmap函数的典型用法代码示例。如果您正苦于以下问题:Python _load_bitmap函数的具体用法?Python _load_bitmap怎么用?Python _load_bitmap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_load_bitmap函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, frame_object):
""" Constructor for toolbar object
@type self: Toolbar
@type frame_object: MainFrame
the frame object that the toolbar will be in/part of
@rtype: None
"""
NavigationToolbar2WxAgg.__init__(self, frame_object.canvas)
self.frame_object = frame_object
# Deleting unwanted icons in standard toolbar
self.DeleteToolByPos(8)
self.DeleteToolByPos(1)
self.DeleteToolByPos(1)
self.InsertSeparator(6)
self.InsertSeparator(6)
self.AddSimpleTool(self.ON_PREVIOUS, _load_bitmap('back.png'),
'Previous Run', 'Activate custom control')
wx.EVT_TOOL(self, self.ON_PREVIOUS, self._on_previous)
self.AddSimpleTool(self.ON_NEXT, _load_bitmap('forward.png'),
'Next Run', 'Activate custom control')
wx.EVT_TOOL(self, self.ON_NEXT, self._on_next)
self.AddSimpleTool(self.ON_EXTRACT, _load_bitmap('filesave.png'),
'Save to Excel', 'Activate custom control')
wx.EVT_TOOL(self, self.ON_EXTRACT, self._on_extract)
示例2: __init__
def __init__(self, canvas, cankill):
NavigationToolbar2WxAgg.__init__(self, canvas)
# for simplicity I'm going to reuse a bitmap from wx, you'll
# probably want to add your own.
self.ON_PREVIOUS = wx.NewId()
self.ON_NEXT = wx.NewId()
self.ON_LISTE = wx.NewId()
self.AddSimpleTool(self.ON_PREVIOUS, _load_bitmap('stock_left.xpm'), 'Courbe precedente', 'Courbe precedente')
self.AddSimpleTool(self.ON_NEXT, _load_bitmap('stock_right.xpm'), 'Courbe suivante', 'Courbe suivante')
self.AddSimpleTool(self.ON_LISTE, _load_bitmap('stock_up.xpm'), 'Liste par date', 'Liste par date')
wx.EVT_TOOL(self, self.ON_PREVIOUS, self._on_previous)
wx.EVT_TOOL(self, self.ON_NEXT, self._on_next)
wx.EVT_TOOL(self, self.ON_LISTE, self._on_liste)
self.diryears = datayears
print self.diryears
#keys_sort = self.diryears.keys()
#keys_sort.sort()
#self.premyear = self.diryears[keys_sort[0]]
#self.premyear = datayears[0]
self.premyear = 2005
#self.deryear = self.diryears[keys_sort[len(keys_sort)-1]]
#self.deryear = datayears[len(datayears)-1]
self.deryear = 2012
self.njour = self.premyear
self.compteuryear = 0
self.prepdata()
self.draw()
示例3: __init__
def __init__(self, graph_canvas):
super(BioPepaToolbar, self).__init__(graph_canvas)
cwd = os.getcwd()
#WorldState.Instance() = WorldState.Instance()
if (platform.system() == "Linux"):
#save
self.DeleteToolByPos(8)
#subplots
self.DeleteToolByPos(7)
self.AddSimpleTool(self.ON_CUSTOM_ENLARGE, _load_bitmap(cwd + '/icons/full_screen.xpm'), 'Enlarge Graph', 'Enlarge Graph')
wx.EVT_TOOL(self, self.ON_CUSTOM_ENLARGE, self._on_custom_enlarge)
self.AddSimpleTool(self.ANNOTATE_ARROW, _load_bitmap(cwd + '/icons/arrow.xpm'), 'Annotate with an Arrow', 'Annotate with an Arrow')
wx.EVT_TOOL(self, self.ANNOTATE_ARROW, self._on_custom_annotate_arrow)
self.AddSimpleTool(self.ANNOTATE_TEXT, _load_bitmap(cwd + '/icons/text.xpm'), 'Annotate with Text', 'Annotate with Text')
wx.EVT_TOOL(self, self.ANNOTATE_TEXT, self._on_custom_annotate_text)
self.AddSimpleTool(self.ANNOTATE_TEXT_ARROW, _load_bitmap(cwd + '/icons/text_arrow.xpm'), 'Annotate with an Arrow and Text', 'Annotate with an Arrow and Text')
wx.EVT_TOOL(self, self.ANNOTATE_TEXT_ARROW, self._on_custom_annotate_text_arrow)
self.AddSimpleTool(self.ANNOTATE_CIRCLE, _load_bitmap(cwd + '/icons/circle.xpm'), 'Annotate with a circle', 'Annotate with a circle')
wx.EVT_TOOL(self, self.ANNOTATE_CIRCLE, self._on_custom_annotate_circle)
示例4: __init__
def __init__(self, canvas, cankill):
NavigationToolbar2WxAgg.__init__(self, canvas)
self.canvas = canvas
#setattr(self,'datajours', getattr(canvas.GetParent(),'datajours'))
for name in dir(canvas.GetParent()):
#print "name= :", name
if name in ["datayear","vg0","vg0_2","year","nyear","month","day","nday","pm10","aot1020"]:
setattr(self,name,getattr(canvas.GetParent(),name))
# for simplicity I'm going to reuse a bitmap from wx, you'll
# probably want to add your own.
self.ON_PREVIOUS = wx.NewId()
self.ON_NEXT = wx.NewId()
self.ON_LISTE = wx.NewId()
self.AddSimpleTool(self.ON_PREVIOUS, _load_bitmap('stock_left.xpm'), 'Courbe precedente', 'Courbe precedente')
self.AddSimpleTool(self.ON_NEXT, _load_bitmap('stock_right.xpm'), 'Courbe suivante', 'Courbe suivante')
self.AddSimpleTool(self.ON_LISTE, _load_bitmap('stock_up.xpm'), 'Liste par date', 'Liste par date')
wx.EVT_TOOL(self, self.ON_PREVIOUS, self._on_previous)
wx.EVT_TOOL(self, self.ON_NEXT, self._on_next)
wx.EVT_TOOL(self, self.ON_LISTE, self._on_liste)
self.inityear()
self.draw()
示例5: _init_toolbar
def _init_toolbar(self):
self._parent = self.canvas.GetParent()
self._NTB2_HOME = wx.NewId()
self._NTB2_BACK = wx.NewId()
self._NTB2_FORWARD = wx.NewId()
self._NTB2_PAN = wx.NewId()
self._NTB2_ZOOM = wx.NewId()
self._NTB2_SAVE = wx.NewId()
self._NTB2_PRINT = wx.NewId()
self._NTB2_RESET = wx.NewId()
# for mpl 1.2+ compatibility
self.wx_ids = {}
self.wx_ids['Back'] = self._NTB2_BACK
self.wx_ids['Forward'] = self._NTB2_FORWARD
self.wx_ids['Pan'] = self._NTB2_PAN
self.wx_ids['Zoom'] = self._NTB2_ZOOM
self.SetToolBitmapSize(wx.Size(24, 24))
context_tip = 'Graph Menu: \n'
context_tip += ' For more menu options, \n'
context_tip += ' right-click the data symbols.'
context = wx.ArtProvider.GetBitmap(wx.ART_LIST_VIEW, wx.ART_TOOLBAR)
self.AddSimpleTool(self._NTB2_HOME, context, context_tip, context_tip)
self.InsertSeparator(1)
self.AddSimpleTool(self._NTB2_BACK, _load_bitmap('back.png'),
'Back', 'Back navigation view')
self.AddSimpleTool(self._NTB2_FORWARD, _load_bitmap('forward.png'),
'Forward', 'Forward navigation view')
# todo: get new bitmap
self.AddCheckTool(self._NTB2_PAN, _load_bitmap('move.png'),
shortHelp='Pan',
longHelp='Pan with left, zoom with right')
self.AddCheckTool(self._NTB2_ZOOM, _load_bitmap('zoom_to_rect.png'),
shortHelp='Zoom', longHelp='Zoom to rectangle')
self.AddSeparator()
self.AddSimpleTool(self._NTB2_SAVE, _load_bitmap('filesave.png'),
'Save', 'Save plot contents to file')
print_bmp = wx.ArtProvider.GetBitmap(wx.ART_PRINT, wx.ART_TOOLBAR)
self.AddSimpleTool(self._NTB2_PRINT, print_bmp, 'Print', 'Print plot')
reset_bmp = wx.ArtProvider.GetBitmap(wx.ART_GO_HOME, wx.ART_TOOLBAR)
self.AddSimpleTool(self._NTB2_RESET, reset_bmp, 'Reset', 'Reset graph range')
bind(self, wx.EVT_TOOL, self.context_menu, id=self._NTB2_HOME)
bind(self, wx.EVT_TOOL, self.forward, id=self._NTB2_FORWARD)
bind(self, wx.EVT_TOOL, self.back, id=self._NTB2_BACK)
bind(self, wx.EVT_TOOL, self.zoom, id=self._NTB2_ZOOM)
bind(self, wx.EVT_TOOL, self.pan, id=self._NTB2_PAN)
bind(self, wx.EVT_TOOL, self.save_figure, id=self._NTB2_SAVE)
bind(self, wx.EVT_TOOL, self.print_figure, id=self._NTB2_PRINT)
bind(self, wx.EVT_TOOL, self.home, id=self._NTB2_RESET)
self.Realize()
示例6: __init__
def __init__(self, plotCanvas):
CONFIGURE_SUBPLOTS_TOOLBAR_BTN_POSITION = 6
NavigationToolbar2Wx.__init__(self, plotCanvas)
# delete the toolbar button we don't want
self.DeleteToolByPos(CONFIGURE_SUBPLOTS_TOOLBAR_BTN_POSITION)
# add the new toolbar buttons that we do want
self.AddSimpleTool(self.ON_CUSTOM_LEFT, _load_bitmap('stock_left.xpm'),
'Pan to the left', 'Pan graph to the left')
wx.EVT_TOOL(self, self.ON_CUSTOM_LEFT, self._on_custom_pan_left)
self.AddSimpleTool(self.ON_CUSTOM_RIGHT, _load_bitmap('stock_right.xpm'),
'Pan to the right', 'Pan graph to the right')
wx.EVT_TOOL(self, self.ON_CUSTOM_RIGHT, self._on_custom_pan_right)
示例7: __init__
def __init__(self, canvas, cankill):
NavigationToolbar.__init__(self, canvas)
# for simplicity I'm going to reuse a bitmap from wx, you'll
# probably want to add your own.
if 'phoenix' in wx.PlatformInfo:
self.AddTool(self.ON_CUSTOM, 'Click me',
_load_bitmap('back.png'),
'Activate custom contol')
self.Bind(wx.EVT_TOOL, self._on_custom, id=self.ON_CUSTOM)
else:
self.AddSimpleTool(self.ON_CUSTOM, _load_bitmap('back.png'),
'Click me', 'Activate custom contol')
self.Bind(wx.EVT_TOOL, self._on_custom, id=self.ON_CUSTOM)
示例8: __init__
def __init__(self, parent, canvas, cankill, OnUndo):
self.cid = 0
self.circles = []
self.point3 = array([])
self.point2 = array([])
self.lines = []
self.hist = ["start"]
NavigationToolbar2WxAgg.__init__(self, canvas)
self.statbar = None
self.OnUndo = OnUndo
self.parent = parent
if self.parent.mpl_old:
self.wx_ids = {"Pan": self._NTB2_PAN, "Zoom": self._NTB2_ZOOM}
self.AddSeparator()
self.AddCheckTool(
self.ON_MARKRINGS,
_load_bitmap(os.path.join(self.parent.iconspath, "3_point.png")),
shortHelp="Mark Rings",
longHelp="mark 3-points on a ring to find center",
)
wx.EVT_TOOL(self, self.ON_MARKRINGS, self._on_markrings)
self.AddCheckTool(
self.ON_MARKSPOTS,
_load_bitmap(os.path.join(self.parent.iconspath, "2_point.png")),
shortHelp="Mark Spots",
longHelp="mark 2 spots to measure distance",
)
wx.EVT_TOOL(self, self.ON_MARKSPOTS, self._on_markspots)
self.AddSeparator()
self.AddSimpleTool(
self.ON_INTEGRATE,
_load_bitmap(os.path.join(self.parent.iconspath, "profile.png")),
"Profile",
"Extract profiles from the diffraction pattern",
)
wx.EVT_TOOL(self, self.ON_INTEGRATE, self._on_integrate)
undo_ico = wx.ArtProvider.GetBitmap(wx.ART_UNDO, wx.ART_TOOLBAR, (16, 16))
self.AddSimpleTool(self.ON_UNDO, undo_ico, "Undo", "Undo last point or ring")
wx.EVT_TOOL(self, self.ON_UNDO, self._on_undo)
示例9: __init__
def __init__(self, canvas, cankill):
NavigationToolbar2WxAgg.__init__(self, canvas)
# for simplicity I'm going to reuse a bitmap from wx, you'll
# probably want to add your own.
self.AddSimpleTool(self.ON_CUSTOM, _load_bitmap("stock_left.xpm"), "Click me", "Activate custom contol")
EVT_TOOL(self, self.ON_CUSTOM, self._on_custom)
示例10: __init__
def __init__(self, canvas, main):
self.main = main
navId = wx.NewId()
NavigationToolbar2WxAgg.__init__(self, canvas)
self.AddSimpleTool(navId, _load_bitmap("subplots.png"), "Range", "Set plot range")
wx.EVT_TOOL(self, navId, self.on_range)
示例11: __init__
def __init__(self, canvas, cankill):
NavigationToolbar.__init__(self, canvas)
# for simplicity I'm going to reuse a bitmap from wx, you'll
# probably want to add your own.
tool = self.AddTool(wx.ID_ANY, 'Click me', _load_bitmap('back.png'),
'Activate custom contol')
self.Bind(wx.EVT_TOOL, self._on_custom, id=tool.GetId())
示例12: SetToolBar
def SetToolBar(self, toolbar):
from matplotlib.backends.backend_wx import _load_bitmap
toolbar.Hide()
tb = self.CreateToolBar((wx.TB_HORIZONTAL|wx.TB_TEXT))
_NTB2_HOME = wx.NewId()
_NTB2_BACK = wx.NewId()
_NTB2_FORWARD = wx.NewId()
_NTB2_PAN = wx.NewId()
_NTB2_ZOOM = wx.NewId()
_NTB2_SAVE = wx.NewId()
_NTB2_SUBPLOT = wx.NewId()
tb.AddSimpleTool(_NTB2_HOME, _load_bitmap('home.png'), 'Home', 'Reset original view')
tb.AddSimpleTool(_NTB2_BACK, _load_bitmap('back.png'), 'Back', 'Back navigation view')
tb.AddSimpleTool(_NTB2_FORWARD, _load_bitmap('forward.png'), 'Forward', 'Forward navigation view')
tb.AddCheckTool(_NTB2_PAN, _load_bitmap('move.png'), shortHelp='Pan', longHelp='Pan with left, zoom with right')
tb.AddCheckTool(_NTB2_ZOOM, _load_bitmap('zoom_to_rect.png'), shortHelp='Zoom', longHelp='Zoom to rectangle')
tb.AddSeparator()
tb.AddSimpleTool(_NTB2_SUBPLOT, _load_bitmap('subplots.png'), 'Configure subplots', 'Configure subplot parameters')
tb.AddSimpleTool(_NTB2_SAVE, _load_bitmap('filesave.png'), 'Save', 'Save plot contents to file')
self.Bind(wx.EVT_TOOL, toolbar.home, id=_NTB2_HOME)
self.Bind(wx.EVT_TOOL, toolbar.forward, id=_NTB2_FORWARD)
self.Bind(wx.EVT_TOOL, toolbar.back, id=_NTB2_BACK)
self.Bind(wx.EVT_TOOL, toolbar.zoom, id=_NTB2_ZOOM)
self.Bind(wx.EVT_TOOL, toolbar.pan, id=_NTB2_PAN)
self.Bind(wx.EVT_TOOL, toolbar.configure_subplots, id=_NTB2_SUBPLOT)
self.Bind(wx.EVT_TOOL, toolbar.save_figure, id=_NTB2_SAVE)
tb.Realize()
示例13: _init_toolbar
def _init_toolbar(self, *args):
NavigationToolbar2Wx._init_toolbar(self, *args)
self.AddSimpleTool(_NTB_PLAY, _load_bitmap('forward.xpm'),
'Play', 'Start playing')
self.AddSimpleTool(_NTB_LEFT, _load_bitmap('stock_left.xpm'),
'Left', 'Jump one screen to the left')
self.AddSimpleTool(_NTB_RIGHT, _load_bitmap('stock_right.xpm'),
'Right', 'Jump one screen to the right')
self.AddSimpleTool(_NTB_DOWN, _load_bitmap('stock_down.xpm'),
'Down', 'Go down one channel')
self.AddSimpleTool(_NTB_UP, _load_bitmap('stock_up.xpm'),
'Up', 'Go up one channel')
self.Bind(EVT_REDRAW, self._on_redraw)
bind(self, wx.EVT_TOOL, self._on_play, id=_NTB_PLAY)
bind(self, wx.EVT_TOOL, self._on_left, id=_NTB_LEFT)
bind(self, wx.EVT_TOOL, self._on_right, id=_NTB_RIGHT)
bind(self, wx.EVT_TOOL, self._on_down, id=_NTB_DOWN)
bind(self, wx.EVT_TOOL, self._on_up, id=_NTB_UP)
示例14: __init__
def __init__(self, plotCanvas):
# create the default toolbar
NavigationToolbar.__init__(self, plotCanvas)
# find where icons are located
path = os.path.dirname(__file__)
icon_file = os.path.join(path, 'data-export-icon.png')
self.AddSimpleTool(self.EXPORT_DATA, _load_bitmap(icon_file),
'Export data', 'Export current data to file')
wx.EVT_TOOL(self, self.EXPORT_DATA, self._on_export_data)
示例15: __init__
def __init__(self, plot_canvas):
NavigationToolbar2WxAgg.__init__(self, plot_canvas)
#Delete home tool
#TODO add after history clear is added at each plot_refresh
self.DeleteToolByPos(0)
#add refresh plot button
self.AddSimpleTool(self.ON_CUSTOM, _load_bitmap('stock_refresh.xpm'),
'Click me', 'Activate custom control')
wx.EVT_TOOL(self, self.ON_CUSTOM, self._on_custom)