def __init__(self, fig, gs, label='mean', color='black', alpha=1.0, min_itr=10):
self._fig = fig
self._gs = gridspec.GridSpecFromSubplotSpec(1, 1, subplot_spec=gs)
self._ax = plt.subplot(self._gs[0])
self._label = label
self._color = color
self._alpha = alpha
self._min_itr = min_itr
self._ts = np.empty((1, 0))
self._data_mean = np.empty((1, 0))
self._plots_mean = self._ax.plot([], [], '-x', markeredgewidth=1.0,
color=self._color, alpha=1.0, label=self._label)[0]
self._ax.set_xlim(0-0.5, self._min_itr+0.5)
self._ax.set_ylim(0, 1)
self._ax.minorticks_on()
self._ax.legend(loc='upper right', bbox_to_anchor=(1, 1))
self._init = False
self._fig.canvas.draw()
self._fig.canvas.flush_events() # Fixes bug with Qt4Agg backend
评论列表
文章目录