def phase1_plot_update(f, ax1, ax2, data, passed, results, fails, failure_criteria, progress):
ax1.cla()
ax2.cla()
sns.tsplot(data.ch1, time=data.time, color="g" if passed else "r", ax=ax1, interpolate=True)
if len(results) > 1:
try:
sns.distplot(results, norm_hist=False, rug=True, ax=ax2)
except Exception:
pass
ax1.set(title='Transition Waveform', xlabel='Time (sec)', ylabel='Amplitude (V)')
ax2.set(title="Risetime Histogram", ylabel="Density", xlabel="Risetime (sec)")
ax2.annotate('Outside Spec: %d / %d\nCompleted %d%%' % (len(fails), len(results), progress), xy=(0.75,0.90), xycoords='axes fraction', fontsize=14)
xlims = ax2.get_xlim()
ax2.axvspan(failure_criteria,xlims[1] - 0.001*(xlims[1] - xlims[0]), alpha=0.1, color='red')
plt.pause(0.01)
评论列表
文章目录