【发布时间】:2014-07-20 18:46:51
【问题描述】:
当我尝试使用 ggplot 绘制时间序列时,x 轴标签变得过于拥挤并相互重叠:
代码是:
plot = ggplot(df, aes(x=df.index, weight='COUNT')) + \
geom_bar() + \
xlab('Date') + \
ylab('Incidents')
我尝试添加以下行
+ theme(axis.text.x = element_text(angle = 90, hjust = 1))
到情节,但它不起作用。这个额外的行给了我错误:
SyntaxError: keyword can't be an expression
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
知道这是怎么发生的,我应该如何解决?谢谢!!
【问题讨论】:
标签: python python-ggplot