National Oceanic and
Atmospheric Administration
United States Department of Commerce

Map Projections in Viewports


The U.S. government is closed. This site will not be updated; however, NOAA websites and social media channels necessary to protect lives and property will be maintained. To learn more, visit commerce.gov.

For the latest forecasts and critical weather information, visit weather.gov.


Map Projections in Viewports

Question:

How can I get the right aspect ratio for map projections in viewports?

Example:


Solution:

The above graphic was created using the mp_viewport_aspect.jnl script.

 set win/size=.4/aspect=`11/8.5` ! set up desired page size and aspect
use coads_climatology
set grid sst ! out of habit, for map projections
shade sst[l=1] ! to initialize the window
set region/x=80w:40e/y=30n:80n
go mp_bonne
go margins 0.4 0.4 0.4 0.8 ! to specify narrow margins
go mp_viewport_aspect 0 1 0 1 mp_vp1
shade/noaxis/nolabel sst[l=7], x_page, y_page
go mp_fland
go mp_label 340 85 0 0 .3 "@TRJuly SST"
go mp_viewport_aspect 0 1 0.5 1 mp_vp2
shade/noaxis/nolabel sst[l=1], x_page, y_page
go mp_fland
go mp_label 340 85 0 0 .3 "@TRJanuary SST"

Further information on the use of this script is available inside the script.