I am able to plot the graph that I want but I would like to change the x-axis tickers to only show the years instead of showing the respective months of each year as the data range is really huge. Is there a possible way for me to do this without having to change my dataset? I am currently using matplotlib.pyplot to plot this graph.
This is the graph that I have currently with the tickers being each of the month of each year.
CodePudding user response:
There are many ways to tackle this problem:
- Add another column for only months and use that column as X,PS:the actual plot won't change.
- use
fig.autofmt__date()
this tilts the dates so that the whole date will be visible.Check this documentation for further details.