绘制数据框

时间:2019-03-27 07:17:28

标签: python-3.x pandas

我有一个由两列组成的数据框,一列带有日期,另一列带有数据。在绘制数据框时,我的x轴已完全显示,即只有一些在打印,这很常见。我要单独打印所有数据列1。

df=DataFrame({'date':n4,'data':n5})
            df.rename(columns={0:'date',1:'data'},inplace=True)
            r3 = df.loc[:,'date'].values
            r4 = df.loc[:,'data'].values
            df.plot(0,marker='*')
            below_threshold = r4 < m[0]
            plt.scatter(r3[below_threshold], r4[below_threshold], color='green') 
            above_threshold = r4 > s[0]
            plt.scatter(r3[above_threshold], r4[above_threshold], color='red')
            plt.axhline(y=s[0],linewidth=1,linestyle='--',color='k')
            plt.axhline(y=m[0],linewidth=1,linestyle='--',color='k')
            plt.show()

My data is in this format

The plot I'm getting is like this. I want the x-axis to be completely plotted

0 个答案:

没有答案