How to make X axis in matplotlib/pylab to NOT sort automatically the values?
问题 Whenever I plot, the X axis sorts automatically (for example, if i enter values 3, 2, 4, it will automatically sort the X axis from smaller to larger. How can I do it so the axis remains with the order I input the values i.e 3, 2, 4 import pylab as pl data = genfromtxt('myfile.dat') pl.axis('auto') pl.plot(data[:,1], data[:,0]) I found one function, set_autoscalex_on(FALSE) but I'm not sure how to use it or whether it is what I want. Thanks 回答1: You could provide a dummy x-range, and then