Scatter Plots, for Rolling data
1 回表示 (過去 30 日間)
古いコメントを表示
HI
I have a large set of data, for example, spanning 6-12 months, that I need to represent in a scatter plot. However, this is a significant amount of data, so I would like to simplify it by implementing a rolling update method. This method would involve removing the oldest data and incorporating new data into the scatter plot. Can this be achieved with any standard library or function?
0 件のコメント
採用された回答
Star Strider
2023 年 12 月 7 日
編集済み: Star Strider
2023 年 12 月 7 日
I am not certain that I fully understaznd what you want to do. Probably the easiest way to do that (without actually deleting any data) is to change the xlim range for the scatter plot. It can be updated fairly easily, although if the independent variable is a datetime value, the units provided to xlim would have to be datetime values as well.
That would go something like this —
D = datetime(2023,01,01)+days(0:100).';
NOx = sin(2*pi*(0:numel(D)-1)/10).' + randn(size(D));
figure
scatter(D, NOx, 25, day(D,'dayofyear'), 'filled')
grid
colormap(turbo)
figure
tiledlayout(4,1)
nexttile
scatter(D, NOx, 25, day(D,'dayofyear'), 'filled')
grid
colormap(turbo)
xlim([D(1) D(14)])
nexttile
scatter(D, NOx, 25, day(D,'dayofyear'), 'filled')
grid
colormap(turbo)
xlim([D(1) D(14)]+caldays(3))
nexttile
scatter(D, NOx, 25, day(D,'dayofyear'), 'filled')
grid
colormap(turbo)
xlim([D(1) D(14)]+caldays(60))
nexttile
scatter(D, NOx, 25, day(D,'dayofyear'), 'filled')
grid
colormap(turbo)
xlim([D(1) D(14)]+caldays(63))
EDIT — (7 Dec 2023 at 12:48)
Added gradient colours to the markers.
.
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!