How can I plot values in worldmap
17 views (last 30 days)
Hi. I am new to matlab and I want to plot different values in the arctic region.
I have a set of longitudinal and latitudinal degrees and valuees for each point. I want to plot the ice concentration in the arctic, and have several points with information. But how to plot it?
I get to se the north pole and the coast lines, but how to go from there to get a map with all the information in it?
( I could not find a region called arctic either, so I chose North Pole ) * worldmap('North Pole')
This is all I have.
Hope to get some help here,
Angus on 11 Jun 2013
you can check out axesm and try executing "maps" to see a list of available projections and IDs to use with axesm. Depending on the format of your data you should be able to find a projection that works well (maybe the universal polar stereographic).
axesm('ups')% include other axesm options as needed to define lat lon range
axis off; % Turns off surrounding box
pcolorm(latd,lond,mapdata) % pseudocolor plot "stretched" to the grid
geoshow(lat,long,'Color','k') %add continental outlines
lat and long are from the 'load coast', latd and lond are 2d matrices of the same dimensions as mapdata.
Unfortunately I havn't worked with the worldmap function so I dont know the options there.
Best luck, Angus
Chad Greene on 12 Jun 2013
Here are a couple of suggestions:
1. Initialize your map with ncpolarm. http://www.mathworks.com/matlabcentral/fileexchange/30414-ncpolarm
2. Plot values with scatterm or pcolorm. If you use pcolorm, by default it sometimes includes a grid which can obscure your data. Get around this by following it up with shading interp or one of the other shading commands.
Hope this helps.
Angus on 17 Jun 2013
From your previous comments:
"The LAT and LON matrix will vary for each week I pull out information from my database. And I will have one CT ( concentration) value for each column in the LAT and LON matrices."
This seems like it will be hard to deal with no matter what plotting method you choose.
If you have access to the algorithm that pulls the information I would start with changing that; instead of ordering by CT values just pull a grid box area and fill any missing values with NaNs.
If not then I would aim to convert the matrices and arrays that you have before trying to plot them. Here are some ideas for the steps to take, if this seems like a reasonable approach then I can help as you go through it.
- find weekly range of lat and lon (max/min)
- construct a 2D grid (meshgrid) for lat and lon according to your range and resolution.
- create a 2D NaN matrix with dimensions of your lat/lon matrices.
- pull CT values from your array and insert them in your NaN matrix at the correct lat/lon.
- use pcolorm(lat,lon,CT) with your new matrices. (or contourm)