Clear Filters
Clear Filters

how to avoid geoshow shrinking the axis

9 views (last 30 days)
Hi there,
apparently, the function geoshow shrinks the current axes: My plots are smaller when I add the coastline with geoshow than when I do not use geoshow. This is especially annoying, since I want to make 36 subplots on an A4-sheet. The subplots are just very tiny with a lot of space between them. Does anybody know how to avoid the shrinking and can help? Thanks, Iris

Accepted Answer

Kelly Kearney
Kelly Kearney on 1 Mar 2013
If you aren't plotting to a map axis, geoshow resets the data aspect ratio to [1 1 1], which may shrink the axis in one direction or the other. If you want to keep the proper aspect ratio of the plot (which I assume you do, or there's really no point of using geoshow rather than plot, patch, etc), you should probably manually position the subplots to occupy as much space as possible prior to calling geoshow. There are a variety of functions on the FEX to help with this (subtightplot, subaxis, subplotplus, etc). The tightmap function can also help you use as much real estate as possible.
For example:
for ii = 1:4
ax(ii) = subaxis(2,2,ii,'sp',0,'mar',0); % FEX #3696
end
C = load('coast');
geoshow(ax(1), C); % Geoshow, no map axis
plot(ax(2), C.long, C.lat); % No projection
axes(ax(3)); axesm('mercator'); geoshow(C); tightmap;
axes(ax(4)); axesm('robinson', 'frame','on'); geoshow(C); tightmap;
  1 Comment
Iris Hinrichs
Iris Hinrichs on 5 Mar 2013
Thanks, Kelly! subaxis nicely (and easily!) fixed the problem. Iris

Sign in to comment.

More Answers (0)

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!