Y-axis reversed when using PyPlot.ylim

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.