how to draw 3 2D plots concurrently with their 3D plot in the same image

조회 수: 13 (최근 30일)
I want to draw an analytical signal in 3D space with it's projection in imaginary-time axes, real-time axes and real-imaginary axes concurrently. when I use command plot3 and then hold on with one of the 3 axes it plot it in the front of image not in the corresponding axes
like this one
  댓글 수: 1
JOSE RENATO COZZOLINO
JOSE RENATO COZZOLINO 2021년 1월 3일
Hello there, I tried my best to make a corresponding plot code:
f0 = 6;
divs = 30;
t = 0:1/(divs*f0):1;
eixoy = 1*ones(max(size(t)));
eixox = -1*ones(max(size(t)));
eixoz = -0.2*ones(max(size(t)));
X = (1-0.5.*t).*cos(2.*pi.*f0.*t);
Y = (1-0.5.*t).*sin(2.*pi.*f0.*t);
Z = [t; X; Y];
figure
hold on;
plot3(t,X,eixox,'b');
plot3(t,eixoy,Y,'g');
plot3(eixoz,Y,X,'m');
plot3(Z(1,:),Z(2,:),Z(3,:),'k')
xlim([-0.2 1.2])
ylim([-1.2 1.2])
zlim([-1.2 1.2])
grid on;

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

채택된 답변

José-Luis
José-Luis 2014년 5월 1일
편집: José-Luis 2014년 5월 2일
You could use plot3() and consecutively set one of the coordinates as a constant.
data = repmat((1:10)',1,3);
plot3(data(:,1),data(:,2),data(:,3));
l = size(data,1);
hold on;
xl = get(gca,'xlim');
yl = get(gca,'ylim');
zl = get(gca,'zlim');
plot3(data(:,1),data(:,2),repmat(zl(1),l,1));
plot3(data(:,1),repmat(yl(2),l,1),data(:,3));
plot3(repmat(xl(2),l,1),data(:,2),data(:,3));
grid on;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Visual Exploration에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by