Asked by Usman Ali
on 30 Jan 2013

hi, i was searching for getting projection of plots in 3d view, i found a nice shadowplot function for this purpose i am trying to use it for 3d vectors after plot3(..) but not successful. it only works with mesh/surf plots. help

*No products are associated with this question.*

Answer by José-Luis
on 30 Jan 2013

Edited by José-Luis
on 30 Jan 2013

aH = axes; your_data = randn(1000,3); oneMat = ones(size(your_data,1),1); plot3(your_data(:,1),your_data(:,2),your_data(:,3),'b.'); hold on xL = get(aH,'XLim'); yL = get(aH,'XLim'); zL = get(aH,'XLim');

plot3(oneMat .* xL(2), your_data(:,2), your_data(:,3), 'k.'); plot3(your_data(:,1), oneMat .* yL(2), your_data(:,3), 'k.'); plot3(your_data(:,1), your_data(:,2), oneMat .* zL(1), 'k.');

grid on

Please accept an answer if it helps you.

Answer by Jan Simon
on 30 Jan 2013

What about using `surf` instead of `plot3` when the function you have found works for `surf`, but not for `plot3`? There are a lot of examples for surface plots in the FileExchange, search for e.g. "arrow".

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply Today
## 1 Comment

## Jan Simon (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/60386#comment_126065

Please mention any details about the "nice shadowplot function" you have found. We cannot guess which function this is.