Importing us map in MATLAB and specifying points based on their latitude and longitude using boardersm function

2 次查看(过去 30 天)
I want to import US map into MATLAB and specify various locations on the map by circular points. The color of points will be based on the expected solar irradiation on that location. I have been using bordersm function to draw us map in MATLAB. Anybody can help me?

采纳的回答

Yash
Yash 2024-3-21
Hi Mohammad,
Here is a code snippet to mark specific locations on the US map based on their latitude and longitude values and color them based on solar irradiation values:
figure;
% Draw the continental US map with white face color
bordersm('continental us', 'FaceColor', 'w');
% Latitude & Longitude coordinates for New York, Los Angeles, and Chicago
lat = [40.7128, 34.0522, 41.8781];
lon = [-74.0060, -118.2437, -87.6298];
% Solar irradiation data for the three locations
solarIrradiation = [0.9; 0.5; 0.1];
% Plot circular points at the specified latitudes and longitudes
% The size of each point is 20, and the color is based on solar irradiation data
scatterm(lat, lon, 20, solarIrradiation, 'filled');
% Set the colormap to 'jet' which provides a spectrum of colors
colormap(jet);
% Add a colorbar to the figure to indicate the scale of solar irradiation
colorbar;
% Set the limits of the color scale to match the range of solar irradiation data
clim([min(solarIrradiation) max(solarIrradiation)]);
title('US Solar Irradiation Map');

更多回答(0 个)

标签

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by