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@mpProjection = "Robinson"
res@mpOutlineOn = True ; turn on outline
res@mpLimitMode = "LatLon"
res@mpMinLatF = 40 ; zoom in on map
res@mpMaxLonF = 85.
res@mpMinLonF = -140.
res@mpMaxLonF = -60.
res@mpDataBaseVersion = "mediumres" ; select database
res@mpFillOn = True
res@mpFillColors = (/-1,-1,-1,-1/) ; set all areas to transparent fill
; res@mpOutlineBoundarySets = "NoBoundaries" ; outline nothing but those areas
; ; specified below
res@mpOutlineSpecifiers = (/"Alberta","Saskatchewan","British Columbia","Manitoba", \
"Quebec","Ontario","Prince Edward Island","Northwest Territories", \
"Yukon Territory","Newfoundland","Labrador","Nova Scotia", \
"New Brunswick"/)
res@mpFillAreaSpecifiers = "Northwest Territories" ; fill these areas
res@mpSpecifiedFillColors = "gray75" ; fill areas specified in mpFillAreaSpecifiers
; these colors
res@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
This archive was generated by hypermail 2.2.0 : Mon Apr 24 2006 - 09:06:29 MDT