Hi all,
if I plot an normal figure the toolbar contains an button (looks like a checkbox), which can be used to edit the lines and axes parameters. But when I embed such a figure in an Wx application, this specfic button is missing.
Is there a way around it?
Thanks for your help,
Sebi
Parts of the Code:
import wx
import os
import numpy as np
import wx.grid
import filtertools as ft
Matplotlib Figure object
from matplotlib.figure import Figure
import the WxAgg FigureCanvas object, that binds Figure to
WxAgg backend --> a wxPanel
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
import the NavigationToolbar WxAgg widget
from matplotlib.backends.backend_wx import NavigationToolbar2Wx
…
class MplPanel(wx.Panel):
def init(self, *args, **kwds):
wx.Panel.init(self, *args, **kwds)
self.__set_properties()
self.__do_layout()
self.figure = Figure(figsize=(sizex, sizey), dpi=res)
self.axes = self.figure.add_subplot(111)
self.axes.set_xticks(np.arange(self.xmin_limit, self.xmax_limit, 20))
self.axes.set_yticks(np.arange(self.ymin, self.ymax, 0.1));
self.axes.axis([self.xmin,self.xmax,self.ymin,self.ymax])
self.axes.grid(True)
self.axes.set_xlabel(‘Wavelength [nm]’,fontsize=14)
self.axes.set_ylabel(‘Transmission [%] or Intensity [a.u.]’,fontsize=14)
self.figure.subplots_adjust(left=0.07, bottom=0.09, right=0.97, top=0.94,wspace=0.20, hspace=0.20)
self.canvas = FigureCanvas(self, wx.ID_ANY, self.figure)
self.sizer = wx.BoxSizer(wx.VERTICAL)
self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.EXPAND)
self.toolbar = NavigationToolbar2Wx(self.canvas)
self.toolbar.Realize()
self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND)
self.toolbar.Show()
self.SetSizer(self.sizer)
self.Fit()
…
···
–
Dr. Sebastian Rhode
Grünwalder Str. 103a
81547 München
Tel: +49 89 4703091
Mobil: +49 15122810945
sebrhode@…982…