The question tells it all… I've had this problem http://www.mathworks.com/matlabcentral/answers/319515-how-to-fit-axes-to-contourm-plot, which I've solved by changing the point of Origin of the axesm command(it centered the axes on the contourm plot). FLatLimit and FLonLimit did the trick i needed(fix the axes). But that's when it turned back at me. In my first attempt I had the Meridian and Parallel labels showing but not after using Flatlimit and FLonlimit.
I'm almost sure that these two properties are the culprit because I changed it back to MapLat and Lon and labels were showing(then the axes are wrong).
What do I do to have labels? I need my labels…
I'm posting below the two cases I'm talking about…
FIRST CASE Using MapLatLimit and MapLonLimit
min_lat = 31.5062;max_lat = 50.2412;min_lon = 10.4604;max_lon = 42.0652;figure(); title('Using map limit')axesm('MapProjection','lambert',... 'MapLatLimit',[min_lat max_lat],... 'MapLonLimit',[min_lon max_lon],... 'MeridianLabel','on',... 'ParallelLabel','on',... 'Grid','on',... 'Frame','on')load coastlinesplotm(coastlat,coastlon);
SECOND CASE Using Origin, FLatLimit and FLonLimit
min_lat = 31.5062;max_lat = 50.2412;min_lon = 10.4604;max_lon = 42.0652;[dist,az] = distance(min_lat,min_lon,max_lat,max_lon);[originLat,originLon] = reckon(min_lat,min_lon,dist/2,az);midAz = azimuth(originLat,originLon,max_lat,max_lon); lat_limit = [-8 7.8];lon_limit = [5.2 -3.6];figure(); title('Using F limit')axesm('MapProjection','lambert',... 'Origin',[originLat originLon az-midAz+0.3],... 'FLatLimit',lat_limit,... 'FLonLimit',[-dist/2 dist/2] + lon_limit,... 'MeridianLabel','on',... 'ParallelLabel','on',... 'Grid','on',... 'Frame','on')load coastlinesplotm(coastlat,coastlon);
You can run both of them and see the difference. I'll attach the two figures.
Best Answer