Re: Area fill the northern provinces of Canada

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Fri, 21 Apr 2006 15:39:56 -0600

Hi Alex,

To add a single color to your working colormap use NhlNewColor:
http://www.ncl.ucar.edu/Document/Functions/Built-in/NhlNewColor.shtml

and to use a gray set each numerical input to the same value between 0
and 1.0. for example: newcolor = NhlNewColor(wks,.75,.75,.75)
The closer to 1.0 you get the lighter the gray.

To select specific areas to fill is a bit more complicated. I took a bit
from a few examples found on the maps only Applications page:
http://www.ncl.ucar.edu/Applications/maponly.shtml

and I attached it and the corresponding plot here. Basically I outline
every Canadian area (by setting mpOutlineSpecifiers), but only gray fill
the Northwest Territories (by setting mpFillAreaSpecifiers and
mpSpecifiedFillColors).

Let us know if you have any questions about what I did...
Adam

Alex Gardner wrote:
> Does any one know how to area fill (any color) the northern provinces of
> Canada when using a color table which does not include gray?
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli


load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
; ================================================;
begin

  wks = gsn_open_wks("ps","maponly") ; open a ps file
  gsn_define_colormap(wks,"BlWhRe")
  newcolor = NhlNewColor(wks,0.75,0.75,0.75) ; add gray75 to colormap

  res = True ; plot mods desired
  res_at_mpProjection = "Robinson"
  res_at_mpOutlineOn = True ; turn on outline
  res_at_mpLimitMode = "LatLon"
  res_at_mpMinLatF = 40 ; zoom in on map
  res_at_mpMaxLonF = 85.
  res_at_mpMinLonF = -140.
  res_at_mpMaxLonF = -60.
  res_at_mpDataBaseVersion = "mediumres" ; select database

  res_at_mpFillOn = True
  res_at_mpFillColors = (/-1,-1,-1,-1/) ; set all areas to transparent fill
; res_at_mpOutlineBoundarySets = "NoBoundaries" ; outline nothing but those areas
; ; specified below
  res_at_mpOutlineSpecifiers = (/"Alberta","Saskatchewan","British Columbia","Manitoba", \
                              "Quebec","Ontario","Prince Edward Island","Northwest Territories", \
                                                "Yukon Territory","Newfoundland","Labrador","Nova Scotia", \
                                                "New Brunswick"/)
  res_at_mpFillAreaSpecifiers = "Northwest Territories" ; fill these areas
  res_at_mpSpecifiedFillColors = "gray75" ; fill areas specified in mpFillAreaSpecifiers
                                                       ; these colors
  res_at_tiMainString = "Map of Canada"
  plot = gsn_csm_map(wks,res)

end

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

maponly.gif
Received on Fri Apr 21 2006 - 15:39:56 MDT

This archive was generated by hypermail 2.2.0 : Mon Apr 24 2006 - 09:06:45 MDT