how to avoid geoshow shrinking the axis

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

 채택된 답변

Kelly Kearney
Kelly Kearney 2013년 3월 1일

2 개 추천

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

Iris Hinrichs
Iris Hinrichs 2013년 3월 5일
Thanks, Kelly! subaxis nicely (and easily!) fixed the problem. Iris

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by