Main Content

previewmap

View figure at printed size

Description

The appearance of a map onscreen can differ from the final printed output. This results from the difference in the size and shape of the figure window and the area the figure occupies on the printed page. A map that appears readable on screen might be cluttered when the printed output is smaller. Likewise, the relative position of multiple axes can appear different when printed. This function resizes the figure to the printed size.

Examples

Is the text small enough to avoid overlapping in a map of Europe?

figure
worldmap europe
land=shaperead('landareas.shp','UseGeoCoords',true);
geoshow([land.Lat],[land.Lon])
m=gcm;
latlim = m.maplatlimit;
lonlim = m.maplonlimit;
BoundingBox = [lonlim(1) latlim(1);lonlim(2) latlim(2)];
cities=shaperead('worldcities.shp', ...
   'BoundingBox',BoundingBox,'UseGeoCoords',true);
for index=1:numel(cities)
   h=textm(cities(index).Lat, cities(index).Lon, ...
           cities(index).Name);
   trimcart(h)
   rotatetext(h)
end
orient landscape
tightmap
axis off
previewmap

A map of Europe showing the names of cities. Several of the names overlap.

Limitations

The figure cannot be made larger than the screen.

Tips

previewmap changes the size of the current figure to match the printed output. If the resulting figure size exceeds the screen size, the figure is enlarged as much as possible.

Version History

Introduced before R2006a