【发布时间】:2022-01-13 01:53:01
【问题描述】:
您好,我正在尝试获取数据框的线图:
i = [0.01,0.02,0.03,....,0.98,0.99,1.00]
值= [76,98,22,.....,32,98,100]
但是也有从 0,1,...99 开始的索引,当我绘制索引线时也会绘制出来。如何忽略索引的绘图?我使用了以下代码:
plt.plot(df,color= 'blue', label= 'values')
plt.title('values for corresponding i')
plt.legend(loc= 'upper right')
plt.xlabel("i")
plt.ylabel("values")
plt.show()
【问题讨论】:
-
我通过使用 xpoints= i, y points= values 修复了它并做了 plt.plot(xpoints, ypoints)
标签: python dataframe matplotlib plot