こんにちは。ご協力ありがとうございます。MATLAB を使用して 4 つのカラー グループで 3D 散布図を作成しました (アップロード、以下を参照)。ここで、時間に関して散布図をアニメーション化したいと思います。したがって、各ポイントにタイムスタンプがある場合は、それらを順番に表示したいと思います.
たとえば、車の特定の xyz 位置でエラーを悔い改めるポイント A、B、C があり、エラー A が午前 10 時に発生し、エラー B が午後 12 時に発生し、エラー C が午後 3 時に発生した場合、そのポイントをプロットしたいアニメで注文。
また、可能であれば、スクロール バーを備えた GUI を作成して、時間の経過または時間の経過とともにスクロールできるようにして、時間の経過とともにポイントを追加したり、時間を遡ってポイントを削除したりしたいと考えています。または、少なくともスケーター プロセスを一時停止するオプション。
注: 散布図には約 2000 ~ 3000 のポイントが含まれます。これが違いを生むかどうかはわかりません。私もMATLABは初めてです:-)
ご協力いただき、ありがとうございました。敬具
アルフレード
%Scatterplot data
x = [ 50 55 200 210 350 360 400 450 550 560 600 670 750 850 860];
y = [ 50 -50 100 -100 150 -150 151 -151 150 -150 152 -152 150 -150 150];
z = [ 120 120 100 300 100 300 100 300 100 300 100 300 100 300 100];
% alocates space for the z data by creating a matrix array of all ones
g = [0*ones(3,1);1*ones(3,1); 2*ones(3,1); 3*ones(3,1); 4*ones(3,1); ];
%set specific RGB color value for positions 0-4 and background color
color = [0 0 0; 1 0 0; 0 0 1; 1 1 0; 0 1 0]
whitebg([ 0.6758 0.8438 0.8984]) % light blue background
% gscatter creates a 2D matrix with the values from x and y
% and creates groups acording to the 'g' matrix size
% h = gscatter captures output argument and returns an array of handles to the lines on the graph)
h = gscatter(x, y, g, color)
%% for each unique group in 'g', set the ZData property appropriately
gu = unique(g);
for k = 1:numel(gu)
set(h(k), 'ZData', z( g == gu(k) ));
end
%set the aspect ratio, grid lines, and Legend names for the 3D figure
daspect([4.5 5 5])
grid on
legend('Position 0','Position 1','Position 2','Position 3','Position 4')
% view a 3D grapgh (for 2D set to "2")
view(3)