0

I have pulled in a dataset that I want to use. The only columns I am interested in for now are 'Date' and Adjusted. Example snippet is below.

Snippet of dataset

The code I currently have is:

x = data['Date']
y = data['Adjusted']

fig = plt.figure(dpi=128, figsize=(7,3))
plt.plot(x,y)

plt.title("FTSE 100 Growth", fontsize=25)
plt.xlabel("Date", fontsize=14)
plt.ylabel("Adjusted %", fontsize=14)
plt.show()

However, when I run it I get essentially a solid black line across the bottom where all of the dates are covering each other up.

How do I limit the number of date ticks and labels to say 10 or 15? If you do have a solution, if you could respond with the edits made to the code itself that would be great. I've tried other solutions I've found on here but I haven't been able to get it to work.

Klevin
  • 1
  • 1
  • How many dates are we talking... i.e. what would the required frequency be (every 4 months, every 6 months, every year?) to get only 10 or 15 ticks/labels? – BigBen May 12 '20 at 17:16
  • @BigBen The data is monthly from October 2003 to May 2020. The number of ticks specifically doesn't matter, I just need it to actually be legible. One for each year might work well. – Klevin May 12 '20 at 17:43
  • 1
    Please [provide a reproducible copy of the DataFrame with `df.to_clipboard(sep=',')`](https://stackoverflow.com/questions/52413246/how-to-provide-a-copy-of-your-dataframe-with-to-clipboard). [Stack Overflow Discourages Screenshots](https://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors). It is likely the question will be downvoted. You are discouraging assistance because no one wants to retype your data or code, and screenshots are often illegible. – Trenton McKinney May 12 '20 at 17:49

0 Answers0