PyPlot reverse y-axis and logarithmic
Is there a way to traverse the y-axis with PyPlot
and make it logarithmic? I know one of two options can be done with
plt.gca().invert_yaxis()
and
plt.yscale('log')
However, the combination doesn't work. Any ideas? Many thanks!
+3
Tomas
source
to share
1 answer
The best way to do it is to simply use it in the following order:
plt.scatter(x, y)
plt.yscale('log')
plt.gca().invert_yaxis()
plt.show()
+2
Michael roberts
source
to share