Y-axis reversed when using PyPlot.ylim

Y axis of pyplot turns upside down when using pyplot.ylim.
Is this an expected behavior of PyPlot.jl?

By the way, are the indices of images/matrixes passed to PyPlot.jl converted to 0-origin?

Thank you in advance!!

Julia: v1.6.0
PyPlot: v2.9.0


using PyPlot, Images

img = rand(20, 20)
img[5, 5] = 255
imshow(img, cmap=plt.cm.gray)
scatter(4, 4, c="r")
# scatter(5, 5, c="r") did not match the point img[5, 5] = 255

imshow(img, cmap=plt.cm.gray)
scatter(4, 4, c="r")
ylim(0, 19)

output image

  1. test.png

  2. test2.png

imshow has the y-axis order reversed compared to other 2-D plots like contourf or pcolor and ylim takes the lower and upper limit as inputs. What you want is ylim(19,0). Like this the same order is kept and you can define limits.

Thank you.
I didn’t know this specification at all.