【发布时间】:2011-03-27 15:29:37
【问题描述】:
我刚刚进入 matplotlib。
我看到一些使用 matplotlib.pyplot 的例子,但是在将 matplotlib 与 wxpython 集成时,我经常看到 matplotlib.figure 之类的
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)
使用matplotlib.figure 和matplotlib.pyplot 进行绘图有什么区别? matplotlib.pyplot可以用于构建wx应用吗?
【问题讨论】:
-
几乎我能找到的所有示例都使用
figure,但我有一个使用pyplot的基本工作示例,只是想更改轴格式。您没有必须为此使用figure;参见例如matplotlib.org/users/pyplot_tutorial.html
标签: python wxpython matplotlib