Plot the live data on the map
6 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone,
I am trieng to visualize the data of certain location on the map over the time .I want to visualize it by changing the color of each point depending on the value of the data.Now, I have the data for each specific points on the map and the data change over time and I couldn't create the loop that visualize my data over the time by changing the color of each point. I tried to use the geobubble(lat,lon) function to create the point but how can I plot over time?
0 件のコメント
回答 (1 件)
Pavan Sahith
2023 年 10 月 18 日
編集済み: Pavan Sahith
2023 年 10 月 18 日
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
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Geographic Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!