Esempio n. 1
0
class SimpleMPLCanvas(object):
    """docstring for SimpleMPLCanvas"""
    def __init__(self, parent):
        super(SimpleMPLCanvas, self).__init__()
        self.parent = parent
        self.plot_properties()
        self.make_navbar()

    def make_navbar(self):
        self.navbar = Navbar(self.canvas)
        self.navbar.SetPosition(wx.Point(0, 0))  # this is not working !!

    def plot_properties(self):
        # Create matplotlib figure
        self.fig = Figure(facecolor='w', figsize=(12, 8))
        self.canvas = FigureCanvas(self.parent, -1, self.fig)

        self.ax = self.fig.add_subplot(111)
Esempio n. 2
0
class SimpleMPLCanvas(object):
    """docstring for SimpleMPLCanvas"""
    def __init__(self, parent):
        super(SimpleMPLCanvas, self).__init__()
        self.parent = parent
        self.plot_properties()
        self.make_navbar()

    def make_navbar(self):
        self.navbar = Navbar(self.canvas)
        self.navbar.SetPosition((180, 0))  # this is now working (MT 2016)

    def plot_properties(self):
        # Create matplotlib figure
        self.fig = Figure(facecolor='lightsteelblue', figsize=(12.5, 8.5))
        self.canvas = FigureCanvas(self.parent, -1, self.fig)
        # self.fig.patch.set_alpha(0.5)
        self.ax = self.fig.add_subplot(111)
        self.ax.xaxis.set_ticklabels([])
        self.ax.yaxis.set_ticklabels([])