Having labels instead of number on axes

Viewed 70

I'm quite new so sorry if I do things wrong but im trying to have labels (North,South.. etc) instead of number but I cannot do it correctly. If you have any Idea ? Here is part of the code :



x_label_list = ['North', 'South', 'East', 'West', 'South-Est-Est','South-Est-South','South-West-West', 'South-West-South', 'North-West-West', 
          'North-West-Noth','North-Est-North','North-Est-Est']



plt.figure(figsize=(5,5))

plt.imshow(viz, cmap='RdYlGn', aspect='auto')

plt.plot(np.array(snow_lines_by_orient)[:,0], np.array(snow_lines_by_orient)[:,1],label="ligne de snow")
ax = plt.gca()
ax.set_xticklabels(x_label_list , rotation=90)
ax.xticks(range(16),(x_label_list for i in range(16)),rotation=90)

plt.colorbar()
plt.legend()
plt.show()

And it show me this : result of my plot

As you can see first it dosn't plot the first element of my label list and it dosent put every labels. I have normally an increment of 22.5 (x axes ) over 360 so 360//22.5= 16 labels (for x axes ) so it should fit normally thanks for your help

0 Answers
Related