I need to format dates on a x-axis ggplot for python bar chart.
How can I do it?
Use scale_x_date() to format dates on the x-axis.
p = ggplot(aes(x='date'), data) + geom_bar() + scale_x_date(labels='%m-%Y')
This gives number of month and the year, for example, 01-1990 You can try other formats.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With