2808 explained code solutions for 75 technologies


python-matplotlibHow to invert X axis


import matplotlib.pyplot as plt

plt.plot([2,1,3,5,3,3,4,5,2,1])
plt.gca().invert_xaxis()
plt.show()ctrl + c
import matplotlib.pyplot as plt

loads Matplotlib module to use plotting capabilities

.plot(

plot specified data

.gca()

returns current axes object

invert_xaxis()

inverts X axis

.show()

render chart in a separate window