Effacer les filtres
Effacer les filtres

Plotting latitude, longitude and array with a shapefile outline

5 vues (au cours des 30 derniers jours)
cloudyclare
cloudyclare le 12 Fév 2019
Commenté : deepthi b le 4 Oct 2020
I have three 120 by 150 arrays, one for latitude, one for longitude and one for solar radiation. I also have a shapefile showing the Ethiopian border.shapefile_ethiopia.png.
I can use pcolor to plot this data but I would really like to use a shapefile to show the Ethiopian country outline on top of this data.
I would really appreciate any help. Thank you!ethiopia_solarradiation.png

Réponse acceptée

Raghav Singhal
Raghav Singhal le 20 Fév 2019
Hi,
You can plot the map outline over your data by using ‘geoshow’ function and setting the 'FaceColor' field to 'none'. If the line isn’t clearly visible, you could alter the ‘linewidth’ field as required. Hope this helps
eg: geoshow('landareas.shp', 'FaceColor', 'none','LineWidth',2);
For more information on the “geoshow function”, you can refer to this link: https://www.mathworks.com/help/map/ref/geoshow.html
  1 commentaire
cloudyclare
cloudyclare le 20 Fév 2019
This is perfect! Thank you very much Raghav, I really appreciate your help! :)
Here's the resulting plot for anyone who may be interested:
and the code:
ethiopia_shape_file='C:\Work\shape_files\ETH_adm0.shp';
figure; pcolor(long_array,lat_array,solar_rad); shading flat; colorbar;
hold on;
geoshow(ethiopia_shape_file, 'FaceColor', 'none','LineWidth',2);data_ethiopiaoutline.png

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Geographic Plots dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by