How do I plot one 3D vector arrow for all points in a 3d scatter
16 ビュー (過去 30 日間)
古いコメントを表示
How do I plot one 3D vector arrow for all points in a 3d scatter?
I have the following code and wish to create one 3d vector arrow representing the overall direction of variables A, B and C combined.
Your help would be most welcome!
% creating 3d scatter plot
% Load data
T = table((rand(100,3)));
T = [table(T.Var1(:,1),'VariableNames',{'A'}),table(T.Var1(:,2),'VariableNames',{'B'}),table(T.Var1(:,3),'VariableNames',{'C'})];
% Make a color index
nc = 16;
offset = 1;
% Create a 3D scatter plot using the scatter3 function
figure
scatter3(T.A, T.B, T.C, 20, 'filled')
view(-34, 14)
% Add title and axis labels
title('Title')
xlabel('A')
ylabel('B')
zlabel('C')
0 件のコメント
回答 (2 件)
JESUS DAVID ARIZA ROYETH
2019 年 12 月 6 日
編集済み: JESUS DAVID ARIZA ROYETH
2019 年 12 月 6 日
% creating 3d scatter plot
% Load data
T = table((rand(100,3)));
T = [table(T.Var1(:,1),'VariableNames',{'A'}),table(T.Var1(:,2),'VariableNames',{'B'}),table(T.Var1(:,3),'VariableNames',{'C'})];
% Make a color index
nc = 16;
offset = 1;
% Create a 3D scatter plot using the scatter3 function
zer=zeros(size(T,1),1)
figure
plot3(T.A,T.B,T.C,'r-')
view(-34, 14)
% Add title and axis labels
title('Title')
xlabel('A')
ylabel('B')
zlabel('C')
2 件のコメント
参考
カテゴリ
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!