python 在绘图之上绘图
python plotting on top of a plot
是否可以在此地块之上放置第二块地块?
我从嵌入式设备获取这些数据,有时该过程会产生一个我无法绘制到我的分布中的值,但如果可能的话,我想以某种方式表示这个缺失值。
我在想如果遇到这个问题的 x 索引在 Y=-5, X=phy 上放一个红色方块会很好。
top_0 = (umax - (umax % 10) + 20)
fig0 = plt.figure(figsize=(18, 12))
axes = fig0.add_subplot(111)
box_plot0 = axes.boxplot(matrix)
plt.setp(box_plot0['fliers'], color='red')
plt.setp(box_plot0['whiskers'], color='black')
plt.setp(box_plot0['medians'], color='blue')
axes.set_title('Graph of {} {} Eye Openings'.format(self.engine, 0))
axes.set_xlabel(x_axis_label)
axes.set_ylabel('Score')
axes.set_ylim(bottom=-5, top=top_0)
yticks_0 = range(0, int(top_0), 10)
axes.yaxis.set_ticks(yticks_0)
axes.yaxis.grid(True, linestyle='-', which='major', color='lightgrey', alpha=0.5)
means0 = [np.mean(x) if len(x) > 0 else 0 for x in matrix]
plt.show()
当它只是关于绘图时,您可以在 plt.show()
之前添加以下代码,其中我假设 x_missing_val
是一个数组,其中包含缺失值的 x 坐标
axes.plot(x_missing_val,-5*ones(x_missing_val.size),'rs')
是否可以在此地块之上放置第二块地块?
我从嵌入式设备获取这些数据,有时该过程会产生一个我无法绘制到我的分布中的值,但如果可能的话,我想以某种方式表示这个缺失值。
我在想如果遇到这个问题的 x 索引在 Y=-5, X=phy 上放一个红色方块会很好。
top_0 = (umax - (umax % 10) + 20)
fig0 = plt.figure(figsize=(18, 12))
axes = fig0.add_subplot(111)
box_plot0 = axes.boxplot(matrix)
plt.setp(box_plot0['fliers'], color='red')
plt.setp(box_plot0['whiskers'], color='black')
plt.setp(box_plot0['medians'], color='blue')
axes.set_title('Graph of {} {} Eye Openings'.format(self.engine, 0))
axes.set_xlabel(x_axis_label)
axes.set_ylabel('Score')
axes.set_ylim(bottom=-5, top=top_0)
yticks_0 = range(0, int(top_0), 10)
axes.yaxis.set_ticks(yticks_0)
axes.yaxis.grid(True, linestyle='-', which='major', color='lightgrey', alpha=0.5)
means0 = [np.mean(x) if len(x) > 0 else 0 for x in matrix]
plt.show()
当它只是关于绘图时,您可以在 plt.show()
之前添加以下代码,其中我假设 x_missing_val
是一个数组,其中包含缺失值的 x 坐标
axes.plot(x_missing_val,-5*ones(x_missing_val.size),'rs')