Re: changing default boundary color for a map

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Thu Apr 19 2012 - 12:44:35 MDT

Hi Rob,
Thanks for providing an easy-to-use code so I could test possible
solutions. As you probably guessed, I don't believe a resource exists to
do what you want. However, I was able to make the national boundaries
black by manually overlaying a second plot on the first. This is done by
drawing your original plot, not advancing the frame, drawing a second
plot (only showing the national boundaries in black) right on top of the
first one, then advancing the frame. The code is attached, along with
the resulting plot. The key with doing this type of manual overlaying is
to get things lined up perfectly, and in this case I didn't have to
change anything.

I see that you wanted to panel this. I don't see a reason why you
couldn't call gsn_panel for your original plots (setting gsnFrame =
False in the panel resource list), then call gsn_panel again for your
set of overlaid plots that only draw the national boundaries. Then
manually call frame.

If this isn't what you wanted, or if you have trouble paneling the
overlaid plots, let us know..
Good luck,
Adam

On 04/17/2012 03:25 PM, Rob Nicholas wrote:
> As an added complication, the color for the county boundaries seems to
> be tied to national boundary color. See, for example, the following
> code which produces the attached plot:
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
> resMap= True
> resMap@mpPerimOn = False
> resMap@mpGridAndLimbOn = False
> resMap@gsnTickMarksOn = False
> resMap@mpDataSetName = "Earth..3"
> resMap@mpDataBaseVersion = "MediumRes"
> resMap@mpOutlineOn = True
> resMap@mpOutlineSpecifiers = "Conterminous US : Counties"
> resMap@mpFillAreaSpecifiers = "Conterminous US : Counties"
> resMap@mpOutlineBoundarySets = "USStates"
> resMap@mpFillOn = True
> resMap@mpSpecifiedFillColors = "red"
> resMap@mpFillAreaSpecifiers = "Pennsylvania : 05"
> resMap@tiMainString = "PA-05: Middle Susquehanna"
> resMap@mpOceanFillColor = "transparent"
> resMap@mpLandFillColor = "transparent"
> resMap@mpInlandWaterFillColor = "transparent"
> resMap@mpUSStateLineColor = "black"
> resMap@mpNationalLineColor = "gray"
> resMap@mpGeophysicalLineColor = "black"
> resMap@mpMinLatF = 24.
> resMap@mpMaxLatF = 50.
> resMap@mpMinLonF = -125.
> resMap@mpMaxLonF = -65.
>
> wks = gsn_open_wks( "newpdf", "climdiv_map" )
> mycolormap = (/ "white", "black", "gray", "red" /)
> gsn_define_colormap( wks, mycolormap )
> plot = gsn_csm_map( wks, resMap )
>
> This does /almost/ exactly what I'm looking for, except that the
> inland boundaries with Mexico and Canada are gray rather than black.
>
> On Tue, Apr 17, 2012 at 10:46 AM, Rob Nicholas <rob.nicholas@psu.edu
> <mailto:rob.nicholas@psu.edu>> wrote:
>> Hi NCLers,
>>
>> I'm trying to produce a map similar to the ones shown in example 15
>> on the "Map Only Plots"
>> <http://ncl.ucar.edu/Applications/maponly.shtml#ex15> page, but with
>> one important twist: I'd like the boundaries for the climate
>> divisions to be gray, while keeping the state, national, and coastal
>> boundaries black.
>>
>> The state, national, and geophysical boundary colors can be changed
>> explicitly via map resources, but it seems that all other boundaries
>> (in the case of the climate divisions, they're considered "counties")
>> are automatically drawn with the foreground color. Altering the
>> colormap to make gray the foreground color makes things complicated
>> because this map is part of a panel plot where the foreground color
>> needs to remain black for the other components.
>>
>> Is there any way to directly alter the color in which the county (or
>> non-state/national/geophysical) boundaries are drawn?
>>
>> Thanks,
>> Rob
>>
>> --
>> Robert Nicholas
>> Postdoctoral Research Fellow
>> Department of Geosciences, Penn State University
>>
>> post: 411 Deike Building, University Park, PA 16802
>> email: rob.nicholas@psu.edu <mailto:rob.nicholas@psu.edu>
>> voice: +1 (814) 808-5610 <tel:%2B1%20%28814%29%20808-5610>
>> web: http://www.geosc.psu.edu/~ren10 <http://www.geosc.psu.edu/%7Eren10>
>>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
______________________________________________________________
Adam Phillips                                asphilli@ucar.edu
NCAR/Climate and Global Dynamics Division       (303) 497-1726
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli



_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Thu Apr 19 12:44:49 2012

This archive was generated by hypermail 2.1.8 : Fri Apr 20 2012 - 16:21:18 MDT