0

i encounter a problem when plotting the graph in Python using plt.

The X axis value didnt match the index value at all and start from zero, i would like the x axis show 2009-03/2009-04 etc instead of starting from zero.

Here is my data table

enter image description here enter image description here

plt.figure()

plt.plot(WTS_summary.values,linewidth=1,alpha = 0.7,c='salmon')
plt.xlabel("X-Axis")
plt.ylabel("Y-Axis")

The plot looks like this

enter image description here

Thanks a lot...i had been stack on this for a long time even i try other plotting method

After suggestion it still show Error. Thank You Himalaya Bir Shrestha

enter image description here

1 Answers1

0

Can you add following line:

plt.xticks(ticks=np.arange(0,len(WTS_summary)), labels=WTS_summary.index))

You need to import numpy first for it.

hbstha123
  • 1,260
  • 11
  • 23