; ; These files are loaded by default in NCL V6.2.0 and newer ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin wks = gsn_open_wks("png","map_on_map") mpres = True ;---Resources for large map mpres@gsnDraw = False mpres@gsnFrame = False mpres@gsnMaximize = True ;---Zoom in on area of interest mpres@mpMinLatF = 41 mpres@mpMinLonF = -72 mpres@mpMaxLatF = 43 mpres@mpMaxLonF = -69.5 mpres@mpOutlineOn = False ; will draw outlines from shapefile mpres@mpFillOn = True mpres@mpOceanFillColor = "skyblue" mpres@mpLandFillColor = "skyblue" mpres@mpInlandWaterFillColor = "skyblue" mpres@pmTickMarkDisplayMode = "Always" lg_map = gsn_csm_map(wks,mpres) ; Create the larger map ;---Resources for small map mpres@gsnMaximize = False ;---This makes map much smaller and moves it over and down a little mpres@vpXF = 0.7 mpres@vpYF = 0.75 mpres@vpWidthF = 0.15 mpres@vpHeightF = 0.15 ;--Turn off tickmarks and labels mpres@tmXBOn = False mpres@tmYLOn = False ;---Zoom out for smaller map mpres@mpMinLatF = 35 mpres@mpMinLonF = -85 mpres@mpMaxLatF = 48 mpres@mpMaxLonF = -65 mpres@mpOceanFillColor = "white" mpres@mpLandFillColor = "forestgreen" mpres@mpInlandWaterFillColor = "white" mpres@mpDataBaseVersion = "MediumRes" ;---Draw state outline mpres@mpOutlineBoundarySets = "USStates" mpres@mpOutlineOn = True sm_map = gsn_csm_map(wks,mpres) ;---Add an arrow and "N" to large map txres = True txres@txFontHeightF = 0.02 txid = gsn_add_text(wks,lg_map,"N~C~~F34~-",-70,42.75,txres) ;---Add filled areas and outlines from shapefiles for larger map. gnres = True gnres@gsFillColor = "yellow" lnres = True lnres@gsLineThicknessF = 2.5 shpid1 = gsn_add_shapefile_polygons(wks,lg_map,"USA_adm/USA_adm2.shp",gnres) shpid2 = gsn_add_shapefile_polylines(wks,lg_map,"USA_adm/USA_adm2.shp",True) draw(lg_map) ; Draws map and attached arrow. ; drawNDCGrid(wks) ; Debugging draw(sm_map) frame(wks) end