Re: mask grid line

From: Mark Chan <cym263_at_nyahnyahspammersnyahnyah>
Date: Mon Mar 28 2011 - 19:43:02 MDT

Hi Mary,

Thanks a lot! Your suggestion works fine. However, the "MaskMaskArea" also cover
the filled values as it is defined below:

  res@mpFillAreaSpecifiers = states ; states has value, e.g. 56.0
  res@mpSpecifiedFillColors = statecolors ; area colors

Are there any way, e.g. by "overlay" or "res@cnFillDrawOrder", to bring the
filled value to the "top"?

Thanks again!
Mark

----- Original Message ----
From: Mary Haley <haley@ucar.edu>
To: Mark Chan <cym263@yahoo.com>
Cc: ncl-talk@ucar.edu
Sent: Mon, March 28, 2011 9:22:49 AM
Subject: Re: mask grid line

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

      
Received on Mon Mar 28 19:43:03 2011

This archive was generated by hypermail 2.1.8 : Tue Apr 05 2011 - 09:01:21 MDT