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

45 views (last 30 days)
Lukas
Lukas on 15 Apr 2014
Answered: Shaarif Zia on 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

Answers (1)

Shaarif Zia
Shaarif Zia on 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.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!