标签: python matplotlib
I am unable to prevent the x values from going least to greatest and I need them in a specific order, is there such a way to do this in Python?
This is what the order of the x values needs to be instead.
答案 0 :(得分:1)
您可以使用“默认” x值绘制它们并更改刻度标签。
plt.plot(Y) plt.xticks(ticks=range(len(Y)), labels=X) # where X is your list with the order you want