import pandas as pd import matplotlib.pyplot as plt import numpy as np %matplotlib inline unrate = pd.read_csv("unrate.csv", encoding="Latin-1") unrate["DATE"] = pd.to_datetime(unrate["DATE"]) first_twelve = unrate[0:12] plt.plot(first_twelve['DATE'], first_twelve['VALUE']) plt.xticks(rotation=90) plt.xlabel("Month") plt.ylabel("Unemployment Rate") plt.title("Monthly Unemployment Trends, 1948") plt.show
What I expected to happen:
I expected to have a plot where all 12 months had their own tick on the x axis (which is the result in the mission on DQ itself.
What actually happened:
Every other date tick is not labelled on the x-ticks. It goes 1948-01, 1948-03, 1948-05, 1948-07, 1948-09, 1948-11. I can see that each plot is in the graph correctly, but half of the x ticks aren’t showing on the x axis.