I have a pandas dataframe 'g' having two columns and looks like:
I am trying to plot it using the code:
g.plot(x = 'date', y = 'some_value', kind = 'bar', figsize = (10, 5), legend = False)
plt.xlabel("date")
plt.ylabel("some value")
plt.show()
which produces the following graph:
This happens since there are 318 days of data starting on 2018-01-02 and ending on 2018-12-11, all of which are plotted resulting in a messy and unreadable x-axis.
I want to reduce the number of labels on x-axis to contain intervals for say every 15 days. How can I do so?
I found an answer but it talks about replacing the same number of intervals with a custom text which is not my problem. I want to reduce the number of intervals with a custom text.
Thanks!