我有一个数据帧,其中行表示一天中的小时数,列表示时间频率。其目的是创建一个三维条形图,每个列代表不同的颜色。我的数据帧如下
frec=pd.read_csv('tiempo.csv', parse_dates='Horas',index_col='Horas')
frec.index=[date.strftime('%H:%M') for date in frec.index]
frec
Inicio MaxExt Fin
18:00 1 1 1
19:00 0 0 3
20:00 1 1 1
21:00 1 1 0
22:00 3 1 0
23:00 9 1 0
00:00 8 3 2
01:00 2 0 1
02:00 3 8 1
03:00 5 3 2
04:00 6 2 6
05:00 6 6 5
06:00 5 6 4
07:00 5 7 2
08:00 2 4 5
09:00 1 6 6
10:00 0 3 2
11:00 2 5 5
12:00 4 1 9
13:00 2 4 2
15:00 0 2 3
14:00 3 2 4
15:00 0 2 3
16:00 1 1 3
17:00 0 2 3
下面几行代码试图创建绘图
^{pr2}$我如何得到一个每列都用不同颜色绘制的图?。也就是说,Inicio列的条是蓝色的,MaxExt列的条是红色的,Fin列的条是黄色的
通过以下方法创建
colors
:输出如下:
相关问题 更多 >
编程相关推荐