Re: mask grid line

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Mar 28 2011 - 08:22:49 MDT

Hi Mark,

The only way that I could see to mask the grid lines was to set:

 res@mpGridMaskMode = "MaskMaskArea"
 res@mpMaskAreaSpecifiers = "Oklahoma"

Unfortunately, this also applies to map fill, so now you don't see the gray over Oklahoma.

If you want the land fill to all be white, you can add:

 res@mpLandFillColor = "transparent"

If you need the land to all be gray, then one way to do this is first draw the map with just the grid lines, and then draw the map without the grid lines, but with the Oklahoma outlines turned on:

. . .

;--- for grid line -----------
  res@mpGridAndLimbOn = True
  res@mpGridLineDashPattern = 2
  res@mpGridLineDashSegLenF = 0.09
  res@mpGridSpacingF = 1.0

  res@gsnFrame = False
  plot = gsn_csm_map_ce(wks,res)

  res@mpGridAndLimbOn = False
  res@mpOutlineSpecifiers = (/"Land","Oklahoma:counties","water"/)
  res@mpUSStateLineColor = "Blue"
  res@mpNationalLineColor = "brown"
  res@mpGeophysicalLineColor= "Blue"

  res@gsnFrame = True
  plot = gsn_csm_map_ce(wks,res)

--Mary

On Mar 26, 2011, at 7:43 PM, Mark Chan wrote:

>
>
> ;-------------------------ncl script----------------------------------------
> load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_csm.ncl"
>
> wks = gsn_open_wks("x11","grid_line_test")
> res = True
> res@pmTickMarkDisplayMode = "Always"
>
> begin
> res@mpMinLonF = -103.5
> res@mpMaxLonF = -94.
> res@mpMinLatF = 33.
> res@mpMaxLatF = 38.
>
> res@mpOutlineOn = True
> res@mpOutlineBoundarySets = "GeophysicalAndUSStates"
> res@mpGeophysicalLineThicknessF = 1.5
> res@mpUSStateLineThicknessF=1.5
> res@mpDataBaseVersion = "Ncarg4_1"
> res@mpDataSetName = "Earth..2"
> res@mpOutlineSpecifiers = (/"Land","Oklahoma:counties","water"/)
> res@mpUSStateLineColor = "Blue"
> res@mpNationalLineColor = "brown"
> res@mpGeophysicalLineColor= "Blue"
>
> ;--- for grid line -----------
> res@mpGridAndLimbOn = True
> res@mpGridLineDashPattern = 2
> res@mpGridLineDashSegLenF = 0.09
> res@mpGridSpacingF = 1.0
> ; res@mpGridMaskMode = "MaskLand" ; Mask grid lines over land.
>
> plot = gsn_csm_map_ce(wks,res)
> end

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Mar 28 08:22:55 2011

This archive was generated by hypermail 2.1.8 : Mon Mar 28 2011 - 08:51:50 MDT