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

27 Ansichten (letzte 30 Tage)
Lukas
Lukas am 15 Apr. 2014
Beantwortet: Shaarif Zia am 4 Aug. 2014
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

Antworten (1)

Shaarif Zia
Shaarif Zia am 4 Aug. 2014
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.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by