df (Pandas DataFrame) has two columns: Date (as datetime64) and Amount (as float).
I plot the values from Amount column against time, using barplot:
sns.barplot(x="Date", y="Amount", data=df)
plt.show()
However, the date labels are a terrible mess (see picture). What would be an elegant way of dealing with this in Pandas? I'm considering removing month and year from the label, or rotating the labels 90 degrees. How would these be done, or is there a better option? Thank you.
This automatically adjusts SNS plot's date x axis so you don't have to manually do this in most cases:
sns_plot.get_figure().autofmt_xdate()
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