how to plot the shadow in a 3D plot (plot3)

조회 수: 28 (최근 30일)
Lukas
Lukas 2014년 4월 15일
답변: Shaarif Zia 2014년 8월 4일
Hello,
I want to plot a shadow of some Values in the x-z plane x-y and y-z plane e.g.
A=rand(1,10);
B=rand(1,10);
C=rand(1,10);
figure
plot3(A,B,C,'x');hold on
plot(A,B,'x','Color',[.5 .5 .5]) % plot a shadow in the x-y plane
xlabel('A')
ylabel('B')
zlabel('C')
grid on
How should I plot the shadows in the x-z and y-z plane, I tried the function shadowplot but this doesnt work.
Thanks
Lukas Dannhardt

답변 (1개)

Shaarif Zia
Shaarif Zia 2014년 8월 4일
You can simply plot the shadow points using plot3 and making one of the axes as zeroes.
For example:
plot3(A,B,zeros(size(C)),'s','color',[0.8 0.8 0.8]);
plot3(zeros(size(A)),B,C,'+','color',[0.8 0.8 0.8]);
plot3(A,zeros(size(B)),C,'o','color',[0.8 0.8 0.8]);
The Plot might not look good. You can verify the plot by seeing the plot in each axis view.
Hope this helps.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by