I'm just getting into matplotlib.
I see some examples of matplotlib.pyplot
used, but when integrating matplotlib with wxpython i often see matplotlib.figure
like
from matplotlib.figure import Figure
...
vboxFigure = wx.BoxSizer(wx.VERTICAL)
self.figure = Figure()
self.axes = self.figure.add_subplot(111)
t = [1,2,3,4,5]
s = [0,0,0,0,0]
self.axes.plot(t,s, 'b-')
self.canvas = FigureCanvas(panel, -1, self.figure)
vboxFigure.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.EXPAND)
hbox.Add(vboxFigure, 1, flag=wx.EXPAND)
What is the difference between plotting using matplotlib.figure
and matplotlib.pyplot
? Can matplotlib.pyplot
be used in building a wx app?
Pyplot is the Matlab-like state-machine API, matplotlib.figure.Figure is part of the object-oriented API. See e.g. this tutorial to get started with the object-oriented API. If you want to create a wx app, you will most likely need to learn the OO API.