Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Matlab, how to change axis orientation?

Tags:

matlab

I have been writing a script in Matlab that plots 3D images, by using plot3.

The axis are run in this interval:

  • x: [1 -> 0]
  • y: [0.01 -> 0]
  • z: [0 -> 1]

The result is provided in this figure:

enter image description here

Now I would like to change the orientation of my axis, and replot the figure with this axis orientation:

  • x: [0 -> 1]
  • y: [0 -> 0.01]
  • z: [0 -> 1]

How could I do this?

Thanx!

like image 240
DavideChicco.it Avatar asked May 17 '12 09:05

DavideChicco.it


1 Answers

You can change the direction of an axis by setting the appropriate direction property, see the XDir, YDir, ZDir properties in the Axes Properties documentation. These properties have the value normal or reverse. To reverse the direction of one of your axis, say the x-axis, use

set(gca, 'XDir', 'reverse')
like image 131
Chris Avatar answered Sep 29 '22 07:09

Chris