我有以下代码:
ax = df30_pivoted.plot(kind='bar', figsize=(30,20), linewidth=5)
plt.xticks(rotation='vertical')
plt.tick_params(labelsize=20)
plt.xlabel('session_date', fontsize=20)
plt.grid(True)
plt.title('', fontdict={'fontsize':60})
legend = ax.legend(loc=0, ncol=1, bbox_to_anchor=(0,1,1), fancybox=True, shadow=False, title='variations', prop={'size':45})
xposition = c12
for xc in xposition:
ax.axvline(x=xc, color='r', linewidth=4)
plt.setp(legend.get_title(), fontsize='30')
plt.show()
我希望上面的代码put vertical line在x轴上的索引与我在c12中的索引相同,c12是一个pandas系列,类型为datetime64[ns]
,但结果条形图没有垂直线:
目前没有回答
相关问题 更多 >
编程相关推荐