How to connect two scatter 3d plots with lines?
10 ビュー (過去 30 日間)
古いコメントを表示
I have two 3D scatter plots as shown below (upper and lower). I would like to connect each dot from lower scatter to each dot from the upper scatter in order.
Each scatter plots have 360000 points. I tried the following. It does work, but Matlab just hangs and takes too long.
It's not feasible to use even at 360 points. xl,yl,zl,xu,yu,zu are all column vectors with 360000 elements.
scatter3(xl, yl, zl,'b.'); %lower scatter
hold on;
scatter3(xu, yu, zu,'m.'); %upper scatter
hold on;
%connect dots
for s=1:length(xl)
plot3([xl(s), xu(s)], [yl(s), yu(s)], [zl(s), zu(s)], 'g-');
end
This is what I get from above. I will have to play with formatting to make it easier to see the shape, but this is what I would like to see.
I would like to know if there is a more efficient way to do this. Thank you.
0 件のコメント
回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Scatter Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!