White space in map grid.
Show older comments
Hello, I'm making a map with surfm but is getting blanks within map grid. I tried to lower the grade, but white space does not come out.

Thank you for your help.
Accepted Answer
More Answers (1)
Chad Greene
on 28 Mar 2016
The surfm function discards a row and column of data on the edges. Here's a brute-force solution:
% Repeat columns on each side of data:
lat = [lat(:,1) lat lat(:,end)];
lon = [lon(:,1) lon lon(:,end)];
z = [z(:,1) z z(:,end)];
% Repeat rows on top and bottom:
lat = [lat(1,:);lat;lat(end,1)];
lon = [lon(1,:);lon;lon(end,1)];
z = [z(1,:);z;z(end,1)];
surfm(lat,lon,z)
3 Comments
IGOR RIBEIRO
on 28 Mar 2016
Kelly Kearney
on 28 Mar 2016
While it's true that surfm (and all surf, pcolor, etc) all drop the last row and column of data when using flat or faceted shading, I think that's unrelated to the OP's issue. The problem with mapping toolbox functions is that they often clip data that is on the edge of the map, even if it isn't on the edge of the full data grid. See my reply for more details.
Chad Greene
on 29 Mar 2016
Interesting. I'll have to keep that in mind.
Categories
Find more on Map Display in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!