multiple axis joint rotation

조회 수: 13 (최근 30일)
Geraldine Maria Palacios Torres
Geraldine Maria Palacios Torres 2021년 10월 28일
답변: Arthi Sathyamurthi 2021년 12월 27일
hi!
I have used scatter3 to plot 3 different data sets that are contained within the same volume (x,y,z)
the problem is I would like for the 3 data sets to rotate together along any axis. How can i do that?
I have tried using this code
t = tiledlayout(1,1);
axcb1 = axes(t);
axcb2 = axes(t);
axcb3 = axes(t);
axcb2.Visible = 'off';
axcb1.Visible = 'off';
linkdata on
%hlink = linkprop([axcb1,axcb2,axcb3],{'CameraPosition','CameraUpVector'});
rotate3d on
also I tried linking the axes with
linkaxes(t.Children)
but it tells me it is only for a maximum of 2 axis
is there any way I can link all data together?
because when i click the rotation icon, only one data set rotates and it looks like it is in another plane
i attach an image for reference
  댓글 수: 2
Chris
Chris 2021년 10월 29일
편집: Chris 2021년 10월 29일
Does this do it?
hlink = linkprop([axcb1,axcb2,axcb3],'View')
Actually, if this does it, then uncommenting the linkprop line would work as well, I would think
Geraldine Maria Palacios Torres
Geraldine Maria Palacios Torres 2021년 11월 1일
it didn't :(
only the last data set moves when rotating, the ones plotted first don't

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

답변 (3개)

Matt J
Matt J 2021년 11월 1일
hlink = linkprop([axcb1,axcb2,axcb3],{'CameraViewAngle','CameraPosition','CameraUpVector'})
  댓글 수: 2
Geraldine Maria Palacios Torres
Geraldine Maria Palacios Torres 2021년 11월 1일
doesn't work either :(
in fact, it only plots one point of one data set
Matt J
Matt J 2021년 11월 1일
in fact, it only plots one point of one data set
The code I gave you doesn't have any plotting commands. That must be coming from somewhere else.

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


Matt J
Matt J 2021년 11월 1일
편집: Matt J 2021년 11월 1일
I have used scatter3 to plot 3 different data sets that are contained within the same volume (x,y,z)
If so, why are you attempting to put them in 3 different axes? Why not just use hold on and hold off to add them to the same axes. That way, you don't have to fuss with axis linking, e.g.,
for i=1:3
X=rand(5,1); Y=rand(5,1); Z=rand(5,1);
scatter3(X,Y,Z,'filled','SizeData',50)
hold on
end
hold off
  댓글 수: 2
Geraldine Maria Palacios Torres
Geraldine Maria Palacios Torres 2021년 11월 1일
I used hold on and hold off, and 3 axis are shown (x-y-z)
The problem is that the data sets do not rotate together.
Only the last data set to be plotted is rotating and the others do not move at all.
Matt J
Matt J 2021년 11월 1일
편집: Matt J 2021년 11월 1일
But you showed us a section of your code where you are creating 3 separate axes.
axcb1 = axes(t);
axcb2 = axes(t);
axcb3 = axes(t);
That shouldn't be there if you're following what I outlined. I suggest you attach a .mat file containing your data and also post the complete code that plots them, so we can better see what's going on.

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


Arthi Sathyamurthi
Arthi Sathyamurthi 2021년 12월 27일
Hello,
In addition to the above suggestions, you can also try the view([azimuth_angle elevation_angle]). You can also refer to the examples in the link here for more information.

카테고리

Help CenterFile Exchange에서 Geographic Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by