When using "geoplot" to create a map, how can I change the map projection to Lambert? It seems that "m_proj" cannot be used together with geoplot.

minlat = 25;
minlon = 65;
maxlat = 45;
maxlon = 108;
m_proj('lambert','lon',[64 108],'lat',[21 48]);
geoplot([minlat maxlat],[minlon maxlon],'-*');
geodensityplot(allLat, allLon, weights*10^8, 'FaceColor', 'interp');
geobasemap none
geolimits([25 45],[65 105]);
%This results in two separate plots. I would like the geoplot to be displayed in Lambert projection.

Answers (1)

Hi 世园 李 ,
It is my understanding that you wish to change the projection type as Lambert for the geoplot function.
The geoplotfunction plots data only in geographic coordinates, hence current axes need to be either geographic or map axes, since current axes set by m_proj are neither geographic nor map axes, it throws an error.
Here’s a workaround to set the projection method as lambert
  • Create a projected CRS object by specifying an EPSG code,5325 for “Lambert Conic Conformal.
p=projcrs(5325);
  • Create a newmap with p as the coordinate reference system (CRS).
newmap(p);
  • Geopmap plots on this map axes follows “Lambert Conic Conformal method”.
Explore the following documentations for more details-
Regards,
Vinayak Luha

Categories

Asked:

on 10 Sep 2023

Commented:

on 23 Dec 2023

Community Treasure Hunt

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

Start Hunting!