필터 지우기
필터 지우기

Scatter Plots, for Rolling data

조회 수: 3 (최근 30일)
Dharmesh Joshi
Dharmesh Joshi 2023년 12월 7일
편집: Star Strider 2023년 12월 7일
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개)

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by