简体   繁体   中英

PyPlot reverse y-axis and logarithmic

Is there a way to both reverse the y-axis with PyPlot and make it logarithmic? I know that one of the two options can be done with

plt.gca().invert_yaxis()

and

plt.yscale('log')

However, the combination does not work. Any ideas? Thanks a lot!

The best way to do this is simply to use this in the following order:

plt.scatter(x, y)
plt.yscale('log')
plt.gca().invert_yaxis()
plt.show()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM