getting plot projection in 3d

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

1 件のコメント

Jan
Jan 2013 年 1 月 30 日
編集済み: Jan 2013 年 1 月 30 日
Please mention any details about the "nice shadowplot function" you have found. We cannot guess which function this is.

サインインしてコメントする。

回答 (2 件)

José-Luis
José-Luis 2013 年 1 月 30 日
編集済み: José-Luis 2013 年 1 月 30 日

1 投票

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.

5 件のコメント

José-Luis
José-Luis 2013 年 1 月 30 日
From your comment, this might be what you want:
your_data = randn(1000,3);
subplot(2,2,1);
plot3(your_data(:,1),your_data(:,2),your_data(:,3),'b.');
subplot(2,2,2)
plot(your_data(:,2), your_data(:,3), 'k.');
subplot(2,2,3)
plot(your_data(:,1),your_data(:,3), 'k.');
subplot(2,2,4)
plot(your_data(:,1), your_data(:,2),'k.');
Usman  Ali
Usman Ali 2013 年 1 月 30 日
I meant i did it with subplots to show you. but i need the projections in a single 3d. your suggested code 1. plots in all in 1 line on zero axis. 2. plots the projection of projected image.
José-Luis
José-Luis 2013 年 1 月 31 日
I don't understand, what's wrong with the way I plotted it? Could you please show an example of what you actually want?
Usman  Ali
Usman Ali 2013 年 2 月 6 日
let's say i have to plot a sin and cos in complex plan with their shadows on the walls t = 0:pi/50:10*pi; plot3(t,cos(t),sin(t)); if i apply shadowplot x or shadowplot y nothing happens...
José-Luis
José-Luis 2013 年 2 月 6 日
That's because you are talking about points. The "shadow" of a point is a point, the "shadow" of a surface is a surface.

サインインしてコメントする。

Jan
Jan 2013 年 1 月 30 日

0 投票

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".

2 件のコメント

Usman  Ali
Usman Ali 2013 年 1 月 30 日
does surf works for vectors :/
Jan
Jan 2013 年 1 月 30 日
Yes. It depends on how you define the inputs.

サインインしてコメントする。

カテゴリ

質問済み:

2013 年 1 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by