Limiting Map Boundaries in Matlab for Scientists

  • Context: MATLAB 
  • Thread starter Thread starter Frank Einstein
  • Start date Start date
  • Tags Tags
    Map Matlab
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
4 replies · 3K views
Frank Einstein
Messages
166
Reaction score
1
Hello everyone. I have generated a world map by plotting coastlat and coastlon. I have done it because I want to plot some data that I have over said map. The problem is that my data goes only from 70N to 40 S and from 45E to 125W, thanks to that, I have a figure which looks like in the adjoint image (made with token data instead of the actual one).

Is there a way to limit the map to the colored area or do I have to manually crop it with paint?

Thanks for your answers.
mapa1.png
 
Last edited by a moderator:
Physics news on Phys.org
How are we to help you if you don’t show us your code?
 
Orodruin said:
How are we to help you if you don’t show us your code?
My code is as follows:
Matlab:
    figure
    contourf(Y,X, proxy_data_1)
    hold on
    axesm mercator;
    plot(coastlon,coastlat,'k','LineWidth',2)
<Moderator's note: code tags added. Please use them.>

While X and Y are defined as: [X,Y] = meshgrid(70:-0.25:-40,-125:0.25:45);

Proxy data is a matrix of size X*Y.
 
Last edited by a moderator:
Did you look up the help for the axesm function?
 
  • Like
Likes   Reactions: Frank Einstein
I am afraid it doesn't work since i am workng with plot instead of plotm; however, you gave me an idea, I have tried to use axis instead of axesm and it does the job. Thank you very much.