1

Hi I am trying to make a graph to display some data, my issue is I want the x-axis to have years value

df6=df6["percent"]
list = df6.values.tolist()

import matplotlib.pyplot as plt

plt.plot(list)
plt.show()

I get the graph 

Graph I have

But I want the graph to be like this Graph I want

Please Help!

Craig
  • 4,605
  • 1
  • 18
  • 28
Rachel
  • 208
  • 1
  • 5
  • 18
  • I think, this link will give you a hint on a way to do what you would like to : https://stackoverflow.com/questions/3100985/plot-with-custom-text-for-x-axis-points – probaPerception Aug 07 '17 at 22:25

1 Answers1

1

I can't tell what your data looks like, but if you loop through your years data and add the value of 1880 to it all, your graph should display the x-axis similarly to the picture you have provided.

For example:

0 + 1880 = 1880
50 + 1880 = 1930
100 + 1880 = 1980

And so on..

Jordan Gleeson
  • 531
  • 1
  • 4
  • 12