How to interchange Z and Y axes direction in MATLAB?

Click For Summary
SUMMARY

This discussion focuses on interchanging the Z and Y axes in a 3D plot using MATLAB. The user employs the isosurface function to create a 3D visualization but seeks to rotate the axes without manipulating the data. The solution involves using the view and camroll commands to achieve the desired axis orientation. This approach allows for the X and Z axes to be horizontal while positioning the Y axis vertically.

PREREQUISITES
  • Familiarity with MATLAB plotting functions, specifically isosurface.
  • Understanding of 3D graphics concepts in MATLAB.
  • Knowledge of the view and camroll commands.
  • Basic understanding of axis manipulation in MATLAB.
NEXT STEPS
  • Research the view command in MATLAB for adjusting 3D plot perspectives.
  • Explore the camroll function to understand its impact on camera orientation.
  • Investigate additional axis manipulation techniques in MATLAB graphics.
  • Review MATLAB documentation on 3D plotting for advanced visualization techniques.
USEFUL FOR

This discussion is beneficial for MATLAB users, particularly those involved in 3D data visualization, including engineers, data scientists, and researchers looking to customize plot orientations.

xnov
Messages
1
Reaction score
0
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));
isonormals(x,y,z,v,p)
set(p,'FaceColor','red','EdgeColor','none');
daspect([1 1 1])
view(3); axis tight
camlight
lighting gouraud
xlabel('x-axis');ylabel('y-axis');zlabel('z-axis');

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?
thanks
 
Physics news on Phys.org
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.
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K