Here is my code:
# Graph for both infections and closures
# # plotting the points
plt.plot(graph_date, graph_daily_infections, label = "Infections per day")
plt.plot(graph_date, graph_total_infections, label = "Infection overall")
plt.plot(graph_date, graph_daily_closure, label = "Closures per day")
plt.plot(graph_date, graph_total_closure, label = "Closure overall")
# # naming the x axis
plt.xlabel('Date')
# naming the y axis
plt.ylabel('Number of Infections/Closure')
# giving a title to my graph
plt.title('Daily infections and closure overtime \n Infection Rate: {0} | Closure Threshold: {1}'.format(infectionRate,closeThreshold))
# show a legend on the plot
plt.legend()
# # changing the scale of the x ticks at the bottom
# # plt.locator_params(nbins=4)
# # set size of the graph
plt.rcParams["figure.figsize"] = (20,15)
# # function to show the plot
plt.show()
The problem with this code is that the dates are squashed together on the x axis when they are being displayed. See below:

Is there a way to only show the months, or to only shows the months and the years ? the interval for which the graph should display the data is for 4 months so showing only the months / year and month would be ideal. Thanks!