when I tried to plot a timeseries with ggplot, the x axis lables became too crowded and overlapped each other:
The code is:
plot = ggplot(df, aes(x=df.index, weight='COUNT')) + \
geom_bar() + \
xlab('Date') + \
ylab('Incidents')
I tried to add the following line
+ theme(axis.text.x = element_text(angle = 90, hjust = 1))
to the plot, but it doesn't work. And this extra line gives me error:
SyntaxError: keyword can't be an expression
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
Any idea how this happened and how should I fix it? Thanks!!