I have some 2D data that effectively represents an image. This image also has spatial dimensions which are important, and those dimensions start in the top left. In python I’d use something like plt.pcolor(x,y,z)
or similar to plot this data, where x and y are vectors and z is a 2D matrix with matching sizes in the appropriate dimensions. (Or I can do something like X,Y = np.meshgrid(x,y)
).
It appears that Plots.heatmap(x, y, z)
is what I’m looking for in Julia. However, it seems that Julia does not like that my coordinate values are in a decreasing order in one axis (the y axis) as I get a “y points not sorted in ascending order” error and the resulting plot is empty except for its axes (which appear correctly, actually).
I know it’s possible to sort the data in to ascending order, but this seems like a kind of odd restriction. Is there a reason for this, or am I misusing the interface?
Edit: I should add that the axis coordinates are linear (in fact formed using y = a_y*range(0,stop=n_y)+b_y
) - just linearly decreasing instead of increasing in this case.