Hello Andres,
I understand you are trying to get the labels outside the frame, the meridians and parallels are not always exactly aligned with the boundaries of the map when the 'Origin' feature is used with an azimuth value other than zero, hence unless otherwise provided, the text labels will be put inside the frame along the edges.
Use the 'MLabelParallel' and 'PLabelMeridian' properties to place the text labels outside the frame. The 'MLabelParallel' and 'PLabelMeridian' parameters specify the latitude and longitude, respectively, for putting the parallel and meridian text labels outside the frame.
Here is a sample code for better understanding:
midLat = 60;
midLon = 15;
bufLon = [-6 6];
bufLat = [-6 6];
midAz = -15;
figure(1)
axesm('mercator',...
'Origin',[midLat midLon midAz],...
'FLonLimit',bufLon,....
'FLatLimit',bufLat,...
'grid', 'on',...
'frame', 'on',...
'meridianlabel', 'on',...
'parallellabel', 'on',...
'plinelocation',5,...
'plabellocation',5,...
'mlinelocation',5,...
'mlabellocation',5,...
'labelrotation','on',...
'MLabelParallel', 61,...
'PLabelMeridian', 16);
ml = getm(gca,'mlabellocation');
setm(gca,'mlabelparallel',61,'mlabellocation',ml)
This example code positions the meridian text labels outside the frame along the 15th longitude meridian and the parallel text labels outside the frame along the 60th latitude parallel.
Hope this resolves your issue.