Lennert Jans
Lennert Jans

Reputation: 11

Interchange the Y and Z axis in 3D- isosurface plot

The last few days I'm having trouble trying to interchange the Y- and Z- axis on a 3D- isosurface plot. I want to interchange the Y- and Z-axis in order to visualise it and to be able to discuss the result more clearly. I remember that in the past I used to interchange the Y- and Z-axis in two ways:

1) using the axis-handle:

    yy = get(gca, 'YData');
    zz = get(gca, 'Zdata');
    set(gca, 'YData', zz, 'ZData', yy);

The error I encounter is the following: 'There is no 'Ydata' property in the 'axes' class.'

2) interchanging by switching the data in the isosurface-command:

isosurface(X, Z, Y, calulated_rotor, iso_value) I get the following error: 'X, Y and Z must be matrices produced by MESHGRID.'

However, X,Y,Z are generated using meshgrid. I tried to solve this error:

    [X Z Y] = meshgrid(x, z, y) % instead of [X Y Z] = meshgrid(x, z, y)  
    % recalculate the velocity matrices VX, VY, VZ: 3D-matrices , code not provided
    calculated_rotor_2 = rotor(X, Z, Y, VX, VZ, VY) % instead of calculated_rotor = rotor(X,Y,Z, VX, VY, VZ)
    isosurface(X, Z, Y, calculated_rotor_2, iso_value) % instead of isosurface(X, Y, Z, calculated_rotor, iso_value)

However this displays not the rotated version of the first rotor I calulated. It displays a wrong calculated rotor. So my main question remains: How can I interchange the Y and Z axis in a correct way?

My Matlab version is R2010a.

Upvotes: 1

Views: 778

Answers (1)

user2271770
user2271770

Reputation:

The 'YData' property belongs to the Surfaceplot, not the Axes, so that's why you get the error. The handle of that Surfaceplot is returned by mesh() call, for example (please check the doc of your plotting function). You could also query the 'Children' property of your gca to obtain this handle (if gca really is the handle of the axis that holds the surface).

As for the rotor call... is it the Curl? If yes, you should be aware that changing the relative orientation of your reference frame (e.g exchanging y and z axes) messes with the the direction of the Curl of your vector field; well, it messes with the vector field itself...

Upvotes: 0

Related Questions