how to avoid geoshow shrinking the axis

5 ビュー (過去 30 日間)
Iris Hinrichs
Iris Hinrichs 2013 年 3 月 1 日
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 日
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