如何在python中绘制从两个选定列到时间的分组条形图。我将把我的资料寄到b

2024-09-30 08:35:42 发布

您现在位置:Python中文网/ 问答频道 /正文

下面是我的数据

             voc_x        isc_x       ff_x         voc_y     isc_y  ff_y
time                        
2017-09-30  63.782472   9.550849    1.488919    61.874962   9.602439    1.429964
2017-10-31  55.189029   7.983348    1.309940    52.859371   7.939833    1.240761
2017-11-30  74.396234   9.259505    1.741323    74.866330   10.232798   1.704126
2017-12-31  83.635085   10.894306   1.882668    83.940575   11.576104   1.860751
2018-01-31  82.980214   10.831514   1.870142    83.073124   11.182076   1.847038
2018-02-28  85.214404   10.695147   2.014127    85.785134   11.898783   1.950388
2018-03-31  79.562794   12.326437   1.789034    80.054074   12.916880   1.763306
2018-04-30  89.114989   11.223809   2.038167    89.770275   11.619562   2.015162
2018-05-31  105.814776  13.075636   2.454240    106.846945  14.197378   2.412194
2018-06-30  106.823234  13.518760   2.482140    107.725764  14.380820   2.457114
2018-07-31  103.054588  12.616497   2.416309    104.097460  13.220893   2.396395
2018-08-31  97.295219   11.295392   2.385163    98.166561   12.535381   2.316326

我需要在python中将isc_Xisc_y的图形绘制为分组条形图vstime(x轴)


Tags: 数据图形time绘制voc中将isc条形图
2条回答

你想要什么有点难理解。你可以添加更多的细节或包括它可能看起来像什么的图像

这就是你想要的:

df.pivot("Time", "isc_x", "isc_y").plot(kind='bar')

可能你想要这样的东西:

df = df[['isc_x', 'isc_y']]
df.plot.bar()
import matplotlib.pyplot as plt
plt.show()

相关问题 更多 >

    热门问题