Scatter Plots, for Rolling data

3 次查看(过去 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?

采纳的回答

Star Strider
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 个)

标签

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by