[ncl-talk] states in map
Karin Meier-Fleischer
meier-fleischer at dkrz.de
Fri Dec 16 02:53:08 MST 2016
Hi Jonathan,
you can use the //
<http://ncl.ucar.edu/Document/Graphics/Resources/mp.shtml#mpFillAreaSpecifiers>
/mpMaskAreaSpecifiers/
<http://ncl.ucar.edu/Document/Graphics/Resources/mp.shtml#mpMaskAreaSpecifiers>
resources to indicate which map areas to fill and mask.
See the masking examples mask_4.ncl and mask_8.ncl in the masking
examples section:
http://ncl.ucar.edu/Applications/mask.shtml
Here is a short script to plot data only for the USA:
begin
f = addfile("rectilinear_grid_2D.nc","r")
var = f->tsurf(0,:,:)
;-- open workstation
wks = gsn_open_wks("png","plot_mask_fill_only_USA")
;-- set resources
res = True
res at cnFillOn = True
res at cnLineLabelsOn = False
res at cnInfoLabelOn = False
res at cnLinesOn = False
res at mpMinLonF = 170
res at mpMaxLonF = 295
res at mpMinLatF = 22
res at mpMaxLatF = 74
res at mpCenterLonF = 215
res at mpDataBaseVersion = "Ncarg4_1"
res at mpAreaMaskingOn = True
res at mpFillBoundarySets = "NoBoundaries"
res at mpMaskAreaSpecifiers = "united states" ;--
enable masking and specify the area
res at mpOutlineBoundarySets = "USStates" ;-- draw
US and state outlines
res at cnFillDrawOrder = "Predraw"
;-- create the plot
plot = gsn_csm_contour_map(wks,var,res)
end
Bye, Karin
Am 16.12.16 um 02:58 schrieb Buzan, Jonathan R:
> Hi NCL-Talk
>
> I am attempting to mask everything except for the United States.
>
> I’ve tried Conterminous US: States, etc. And It keeps saying it doesn’t recognize the mpMaskAreaSpecifiers string.
>
> -Jonathan
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161216/a298122e/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot_mask_fill_only_USA.png
Type: image/png
Size: 47251 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161216/a298122e/attachment.png
More information about the ncl-talk
mailing list