In matlab, how to change the axis orientation?

I wrote a script in Matlab that displays three-dimensional images using plot3.

The axis starts in this interval:

  • x: [1 → 0]
  • y: [0.01 → 0]
  • z: [0 → 1]

The result is shown in the figure:

enter image description here

Now I would like to change the orientation of my axis and copy the shape with this axis orientation:

  • x: [0 → 1]
  • y: [0 → 0.01]
  • z: [0 → 1]

How can i do this?

Thanx!

+5
source share
1 answer

You can change the axis direction by setting the corresponding direction property, see the properties XDir, YDir, ZDirin the Axis Properties Documentation . These properties matter normalor reverse. To reverse the direction of one of your axes, for example the x axis, use

set(gca, 'XDir', 'reverse')
+13
source

All Articles