MATLAB: Changing the x,y axis values

axesdisplayimageimage processingMATLABplot

Hi,
I have a figure of an image showing the pixel number in the x- and y-axis. I would like to display this in angle mrad instead. I know the angle size of one pixel from knowing the pizel size and the distance to light source.
How do I display the angle mrad, 0, 0.5, 1,5 etc in the axes instead of the pixel numbers 1, 2, 3?
Using 'image' to plot the image.

Best Answer

Set the XData (and YData if required) properties of your image, either when first creating it as e.g.
image( hAxes, 1:360, 1:200, myImage )
or afterwards as e.g.
hIm = image( hAxes, myImage );
hIm.XData = 1:360;
etc.
doc image properties
will take you to the help index page from which you can go to the first link which gives more details.
Note: hAxes there is your axes handle. If you aren't using one then you should! Don't get into the habit of plotting things without giving an explicit axes!
Related Question