我想用日期数据作为x轴绘制线段,线段之间不应该重叠。然而,结果图中有一些重叠。在
以下是名为数据.csv
event_start,event_end,event_summary,posture
07:30,07:35,setting up desk,2
07:35,07:47,"fill water bottle, wash mug -> toilet",3
07:47,10:20,work( computer work + work discussion with office mate at desk),2
10:20,10:25,toilet,3
10:25,10:42,work,2
11:42,11:44,go find supervisor ,3
11:44,13:00,work (work discussion with supervisor at desk + computer work),2
13:00,13:30,toilet --> get lunch,2
13:30,14:00,Eat lunch,2
14:00,14:05,clean up,3
14:06,14:51,work (computer work + skype),2
14:51,14:59,toilet -> kitchen to fill ater bottle -> printing,3
14:59,16:31,work,2
16:31,16:42,toilet,3
16:42,17:15,work,2
这是绘图的代码
^{pr2}$
这可能是由线的默认图形样式引起的。在
您可能想使用
solid_capstyle
,和solid_joinstyle
参数来plt.plot()
。例如:威尔·耶尔德:
您还可以考虑使用增加重叠的线宽,以及可以在docs中看到的其他行格式设置
相关问题 更多 >
编程相关推荐