我正在努力使这个情节平顺。但是我做不到。尝试使用splrep进行插值,但不起作用。任何帮助都将不胜感激。该图是使用电流、电压和工作小时的数据框列绘制的。
df2=data[:2000]
plt.subplot(2,1,1)
plt.plot(df2['Op_Hours_Fcpm'],df2['Current'],'r')
plt.xlabel('Operating hours')
plt.title('Current Fluctuations')
plt.subplot(2,1,2)
plt.plot(df2['Op_Hours_Fcpm'],df2['Voltage'],'y')
plt.xlabel('Operating hours')
plt.title('Voltage Fluctuations')
plt.tight_layout()
plt.show()
我也尝试过另一种方式:
fig, ax = plt.subplots()
ax.plot(x_int, current_int, lw = 5, alpha = 0.30, label = 'current')
ax.plot(x_int, voltage_int, lw = 5, alpha = 0.30, label = 'voltage')
ax.set_xlabel('ripples')
ax.set_ylabel('hrs')
# Set the correct xticks
ax.set_xticks(x_map)
ax.set_xticklabels(x)
fig.legend(bbox_to_anchor=(0.7, 0.3), loc='upper left', ncol=1)
fig.show()
这给了这个输出
由于您没有提供原始数据,我尝试使用
产生
第一个子批次的问题是,某些时间包含多个值,包括“零值”和非零值。这可以更容易地看作是散点图
这个可视化问题指向了底层数据的一个问题
一种选择是丢弃零数据,只保留非零数据点
相关问题 更多 >
编程相关推荐