def _write_fig(self, plots, fig_label):
fig = Figure()
ax = fig.add_subplot(111)
for i in xrange(len(plots)):
if plots[i].shape[0] != 2:
raise ValueError, "Attempting to plot matrix with row count other than 2"
if self.legend is not None:
ax.plot(plots[i][0], plots[i][1], self.colours.next(), label=self.legend[i])
else:
ax.plot(plots[i][0], plots[i][1], self.colours.next())
if self.legend is not None:
ax.legend(loc='best')
canvas = FigureCanvas(fig)
canvas.figure.savefig(new_filename(fig_label, 'figure', '.png'))
评论列表
文章目录