Change Number Formatting on X-Axis Matplotlib -


i'm sure easy answer, not find anywhere. want x-axis read values 2000, 2001, 2002, 2003, 2004, not 2 x e**3.

import numpy np  import matplotlib.pyplot plt  x = [2000, 2001, 2002, 2003, 2004] y = [2000, 2001, 2002, 2003, 2004]   plt.xticks(np.arange(min(x), max(x)+1, 1.0))  plt.plot(x,y) plt.show() 

the code returns graph represents values this. how change it?

enter image description here

@ avinash pandey

enter image description here

enter image description here can use

plt.xticks(np.arange(min(x), max(x)+1, 1.0), x) 

try in code space there labels needed... more follow link


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -