1

I am trying to plot the dates from an excel file for a line chart. It is in Column A labeled "Date" and is in the format 3/1/2019. The type is "short date" on excel. I've managed to pull in the excel data and the columns I needed into a data frame. When i try to plot using:

plt.plot(GQ1_Date, GQ1_WICreated)
plt.plot(GQ1_Date, GQ1_Backlog)
plt.show()

GQ1_Date.head() outputs:  

       Date
0 2019-03-01
1 2019-03-02
2 2019-03-03
3 2019-03-04
4 2019-03-05

the x axis reads 2019-03, 2019-05, etc. How do I get it to display the full date with the day and make the ticks display every single date insetad of every 2 months?

1 Answer 1

1

I think that's because your Series is in datetime data type.

Try this.

plt.plot(GQ1_Date['Date'].astype(str), GQ1_WICreated)
plt.plot(GQ1_Date['Date'].astype(str), GQ1_Backlog)
plt.xticks(rotation=90)
plt.show()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.