Re: mask grid line

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 31 2011 - 13:02:43 MDT

Mark,

Usually in this case you would try setting mpFillDrawOrder to
PostDraw. You might also need to play with mpGridAndLimbDrawOrder.
However, this may cause other plot elements, like contours, to be
covered up by other map fill.

You may have to draw the map in two stages in order to get the type of
fill you want. If you can't get this to work, then if you can provide
me with script and data, I might be able to help more. I'm not sure
what you mean below that "states" has a value, like 56.0. The fill
area specifiers array is usually a list of geographical area names,
like "Oklahoma".

--Mary

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

> 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
>
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Mar 31 13:02:54 2011

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