开发者

Matlab - reverse value of axis in plot [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

How do I edit the axes of an image in MATLAB to reve开发者_JAVA百科rse the direction?

Matlab - reverse value of axis in plot [duplicate]

The colour image is plotted using the image function based on some information obtained using imread function and for the white and blue image basically I am selecting the coordinates of the heat point(red and blue and their variations basically) from the map and then displaying them using plot function.

The problem is that the plotted values are reversed on the Y axis and I can't figure out how to reverse the Y axis of the plot in order to obtain the same correlation between the images.

Could you please explain me how to solve this problem?


By default, matlab draws graphs with (0,0) at the bottom left corner. However, it draw images with (0,0) in the top-left corner.

You can change the image axes to standard bottom-left origin by using the command

axis xy;

Remember to make sure that your image is the currently selected figure.


Use rot90() to rotate the matrix, or a combination or fliplr() (flips matrix, left and right) and flipud() (flips matrix up and down) that produced the heat map image.

If you are plotting an image and you don't want to see the axis tic marks you can turn them off with

axis off

if you are interested in changing the direction of either the x-axis and/or y-axis in an axes handle-object, you can use the set function as follows

set(axesHandle,'XDir','rev','YDir','rev')

where you use XDir or YDir (or both) based on the axis you want reversed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜