Hello Romia,
I understand you have the data for each specific points on the map and the data change over time and you need to create a loop that visualize your data over time by changing the colour of each point. To achieve that, you can try using “geobubble” or “geoscatter” function.
Please refer to this below example code that visualize sample data over time by changing the colour of each point.
% Sample latitude, longitude, and data values
lat = [40.7128, 34.0522, 51.5074, 35.6895, 52.5200];
lon = [-74.0060, -118.2437, -0.1278, 139.6917, 13.4050];
data = [10, 5, 8, 12, 7; 9, 4, 7, 11, 6; 11, 6, 9, 13, 8];
% Define the number of time steps
numTimeSteps = size(data, 1);
% Create a figure
figure;
% Loop through each time step
for t = 1:numTimeSteps
% Get the data values at the current time step
currentData = data(t, :);
% Plot the points with colors based on the data values
geoscatter(lat, lon, [], currentData, 'filled');
% Customize the plot properties
colormap jet;
colorbar;
title(['Data Visualization at Time Step ' num2str(t)]);
% Pause to show the plot for 1 second
pause(1);
end
You can also use ‘geobubble’ which specifies different colour bubbles to different categories of data.
Please refer to the MathWorks documentation to know more about
Hope it helps