MATLAB: Finding values from a graph

data acquisition

Hi I have plotted a graph(with pcolor option). Which is a 2D plot showing the values of salinity of florida bay. I want to see the value of salinity which is plotted against Long and lat (in x and y direction). I have enabled the datacursourmode on option but when I click on a certain point it shows only x and y value which is obivious. But I also want the value of salt on that point which I have plotted. Is there any way to get that?

Best Answer

Don't use pcolor. Use imshow(), then call impixelinfo(). As you mouse around it will show you x, y, and the value of the salinity matrix.
imshow(salinity, []);
colormap(gca, parula(256));
hp = impixelinfo();