How to exchange between X and Y axes in a 3D graph?

조회 수: 8 (최근 30일)
Alon Rozen
Alon Rozen 2019년 6월 24일
댓글: Alon Rozen 2019년 6월 24일
Hi,
I have a 3D graph in 'H' axes in 'My figure' figure. The graph is created by few different functions.
After it is done I want to view the graph when 'X' and 'Y' axes change position in a sense thay 'Y' is the horizontal axis and 'X' is the vertical one.
I tried using 'view' function but faied. I cannot use 'rotate' funciton because data is created in different functions, soem that cannot be changed.
I can easily do it using the Rotate 3D tool on the figure but I want to do it by code after the graph is created.
Is there a way to do it?
Thanks,
Alon

답변 (1개)

Aquatris
Aquatris 2019년 6월 24일
편집: Aquatris 2019년 6월 24일
You can use a code like;
h = findobj(gca,'Type','line')
x=get(h,'Xdata')
y=get(h,'Ydata')
z=get(h,'Zdata')
This will extract x,y,and z values in the plot. Then, you can do whatever you want with them.
  댓글 수: 1
Alon Rozen
Alon Rozen 2019년 6월 24일
Thanks Aquatris,
I am not sure that this will work. I have some 3D ellipces there as well as some plots of different markers.
If I could write in code what I can do with the 'Rotate 3D' tool is will solve the problem.
Is there a way to later plot the data again with x and y change place?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by