Re: masking areas

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri, 22 Aug 2008 15:00:18 -0600 (MDT)

Mike,

The way to do filling and masking of map areas is to first
indicate the finest area you want to fill, such that you can then also
indicate which areas you want to mask.

So, if you want to mask four US states, you first need to say you want
to fill *all* the states, and then indicate which ones you want to
mask. Use the mpFillAreaSpecifiers and mpMaskAreaSpecifiers resources
to indicate which areas to fill and mask.

If you also want to mask the ocean and other land (Mexico), you can
indicate these with more generic terms, "land" and "water":

   mask_areas = "US-" + (/"Arizona", "New-Mexico", \
                                         "Utah", "Colorado"/)
   res_at_mpFillDrawOrder = "PostDraw"
   res_at_mpFillAreaSpecifiers = (/"AllUSStates","Land","Water"/)
   res_at_mpSpecifiedFillColors = (/"white","white","white"/)
   res_at_mpMaskAreaSpecifiers = mask_areas

This warrants an example or two on the applications page.

--Mary

On Fri, 22 Aug 2008, Michael Notaro wrote:

> Hello. I only want to display the results over Arizona, New Mexico,
> Utah, and Colorado in the attached plot / script. Could you recommend
> a way to mask out the rest?
> I tried to follow this example: http://www.ncl.ucar.edu/Applications/
> Images/maponly_6_lg.png
> but was unsuccessful.
>
> Thanks, Mike
>
>
> wks = gsn_open_wks ("ps", "lilac_4states")
> plot=new(2,graphic)
> setvalues wks
> "wkColorMap" : "BlWhRe"
> end setvalues
> res = True
> res_at_gsnDraw = False
> res_at_gsnFrame = False
> res_at_cnFillOn = True
> res_at_cnRasterModeOn = True
> res_at_cnLinesOn = False
> res_at_cnLevelSelectionMode = "ExplicitLevels"
> res_at_cnLevels = (/60.,75.,90.,105.,120./)
> res_at_cnFillColors=(/95,79,59,46,31,2/)
> res_at_tiMainFontHeightF = 0.033
> res_at_tiMainString = "Lilac Leaf Onset"
> res_at_tmYROn = False
> res_at_tmXTOn = False
> res_at_mpOceanFillColor = -1
> res_at_pmLabelBarDisplayMode = True
> res_at_lbOrientation = "vertical"
> res_at_mpMinLatF = 30.75
> res_at_mpMaxLatF = 42.25
> res_at_mpMinLonF = -115.25
> res_at_mpMaxLonF = -101.75
> res_at_mpCenterLonF = -108.
> res_at_mpCenterLonF = avg(lon)
> res_at_mpOutlineBoundarySets = "AllBoundaries"
> res_at_mpGeophysicalLineThicknessF = 2.5
> res_at_gsnAddCyclic=False
> plot(0) = gsn_csm_contour_map_ce(wks,gridleaf, res)
>
> res_at_tiMainString = "Lilac Bloom Onset"
> res_at_cnLevels = (/80.,100.,120.,140.,160./)
> plot(1) = gsn_csm_contour_map_ce(wks,gridbloom, res)
>
> pres=True
> pres_at_gsnDraw=True
> pres_at_gsnFrame=True
> pres_at_gsnMaximize = True ; blow up plot
> pres_at_gsnPaperWidth=8.5
> pres_at_gsnPaperHeight=11.0
> pres_at_gsnPaperOrientation="portrait"
> pres_at_gsnPaperMargin=0.07
> pres_at_gsnPanelLeft = 0.04
> pres_at_gsnPanelRight = 0.96
> pres_at_gsnPanelTop = 0.96
> pres_at_gsnPanelBottom = 0.04
> pres_at_gsnPanelYWhiteSpacePercent = 3
> pres_at_gsnPanelRowSpec=True
> gsn_panel(wks,plot,(/1,1/),pres) ; create panel plot
>
>
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Aug 22 2008 - 15:00:18 MDT

This archive was generated by hypermail 2.2.0 : Mon Aug 25 2008 - 15:23:45 MDT