I plot the filled polygons using geoshow and for the parts of the Earth north of S (e.g. Anarctica) it works great. However, for Antarctica, it fills the inverse of Anartica instead. Here is example code use to plot Antarctica:
figure('Name', 'Antartica', 'NumberTitle', 'off', 'Color', 'white');
worldmap('Antarctica');
projection = gcm;
latlim = projection.maplatlimit;
lonlim = projection.maplonlimit;
if ~exist('gshhs_f.i', 'file');
gshhs('gshhs_f.b', 'createindex');
end
antarctica = gshhs('gshhs_f.b', latlim, lonlim);
levels = [antarctica.Level];
land = (levels == 1);
lake = (levels == 2);
island = (levels == 3);
pond = (levels == 4);
ice_front = (levels == 5);
grounding_line = (levels == 6);
geoshow([antarctica(ice_front).Lat], [antarctica(ice_front).Lon], 'DisplayType', 'Polygon', 'FaceColor', [230/255 230/255 230/255]);
geoshow([antarctica(grounding_line).Lat], [antarctica(grounding_line).Lon], 'DisplayType', 'Line', 'Color', [255/255 105/255 180/255]);
geoshow([antarctica(land).Lat], [antarctica(land).Lon], 'DisplayType', 'Polygon', 'FaceColor', [ 0/255 100/255 0/255]);
geoshow([antarctica(lake).Lat], [antarctica(lake).Lon], 'DisplayType', 'Polygon', 'FaceColor', [ 0/255 0/255 128/255]);
geoshow([antarctica(island).Lat], [antarctica(island).Lon], 'DisplayType', 'Polygon', 'FaceColor', [210/255 105/255 30/255]);
geoshow([antarctica(pond).Lat], [antarctica(pond).Lon], 'DisplayType', 'Polygon', 'FaceColor', [ 84/255 84/255 84/255]);
setm(gca, 'FFaceColor', 'cyan');
box('off');
xlabel('lon (deg)', 'fontsize', 12, 'color', 'b');
ylabel('lat (deg)', 'fontsize', 12, 'color', 'b');
axis('tight');
axis('fill');
grid('on');
The results of said plot:
The light gray is supposed to be Antarctica and the cyan is supposed to be the seas, oceans, bays, etc. Clearly it is the inverse.
Here is a simple example of another part of the world (New York City, NY, USA) that plots just fine:
figure('Name', 'NYC, USA', 'NumberTitle', 'off', 'Color', 'white');
latlim = [40 41];
lonlim = [-75 -73];
worldmap(latlim, lonlim);
if ~exist('gshhs_f.i', 'file');
gshhs('gshhs_f.b', 'createindex');
end
nyc = gshhs('gshhs_f.b', latlim, lonlim);
levels = [nyc.Level];
land = (levels == 1);
lake = (levels == 2);
island = (levels == 3);
pond = (levels == 4);
ice_front = (levels == 5);
grounding_line = (levels == 6);
geoshow([nyc(ice_front).Lat], [nyc(ice_front).Lon], 'DisplayType', 'Polygon', 'FaceColor', [230/255 230/255 230/255]);
geoshow([nyc(grounding_line).Lat], [nyc(grounding_line).Lon], 'DisplayType', 'Line', 'Color', [255/255 105/255 180/255]);
geoshow([nyc(land).Lat], [nyc(land).Lon], 'DisplayType', 'Polygon', 'FaceColor', [ 0/255 100/255 0/255]);
geoshow([nyc(lake).Lat], [nyc(lake).Lon], 'DisplayType', 'Polygon', 'FaceColor', [ 0/255 0/255 128/255]);
geoshow([nyc(island).Lat], [nyc(island).Lon], 'DisplayType', 'Polygon', 'FaceColor', [210/255 105/255 30/255]);
geoshow([nyc(pond).Lat], [nyc(pond).Lon], 'DisplayType', 'Polygon', 'FaceColor', [ 84/255 84/255 84/255]);
setm(gca, 'FFaceColor', 'cyan');
box('off');
xlabel('lon (deg)', 'fontsize', 12, 'color', 'b');
ylabel('lat (deg)', 'fontsize', 12, 'color', 'b');
axis('tight');
axis('fill');
grid('on');
Here is its output:
This was the output expected.
I understand this is probably an issue related to the singularites near the poles and MATLAB not quite understanding how to draw a polygon that is open in rectilinear space but closed in spherical space. I have attempted some simple attempts at closing the polygon in rectilinear space myself to no avail. Any assistance with plotting this data in MATLAB R2017b using the full resolution of the GSSHG coastal data set would be much appreciated.