Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How to interchange Z and Y axes direction in MATLAB?

  1. Jun 9, 2010 #1
    i have 3D plot in matlab
    lets say i use example isosurface from matlab help

    [x,y,z,v] = flow;
    p = patch(isosurface(x,y,z,v,-3));
    daspect([1 1 1])
    view(3); axis tight
    lighting gouraud

    but the problem is that z axis is in vertical direction, and x & y is horizontal direction. i want to interchange so that x and z is horizontal direction and y is in vertical direction. well i can manipulate data dan axis label, but i prefer to do without manipulate the data. is there anyone knows how to do it?
  2. jcsd
  3. Jun 9, 2010 #2
    Although you're asking in relation to one of the demo files, rotating the graphics axes for a plot is generally tightly coupled to the particular plot you're working with. You can achieve what you want using a suitable combination of the view and camroll commands.

    Check the docs for examples on how to use them.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook