Re: gsn_polymarker multiple colors

From: Adam Phillips (asphilli AT cgd.ucar.edu)
Date: Tue Nov 23 2004 - 10:59:27 MST


Chad,

I am guessing that you have not changed the colormap, and thus are using the
default NCL colormap.

To change from the default color map: gsn_define_colormap(wks,"temp1")
(see http://ngwww.ucar.edu/ncl/coltable.html for a listing of available color
maps.)
                                        
In your case, you might just want to add one color to the existing colormap. You
can do this by using the NhlNewColor function:

nc1 = NhlNewColor(wks,.45,.1,.1) ;firebrick4?

When you specify a color by name, in your case FireBrick4, NCL tries to find the
color closest to the one you specified. For whatever reason, I am guessing that
NCL thinks the closest color in the default colormap to FireBrick4 is dark
green.

Another good color map web site:
http://ngwww.ucar.edu/ngdoc/ng/ug/ncl/gsun/basics.html#ColorMaps

Adam

>Delivered-To: asphilli@ucar.edu
>Delivered-To: ncl-talk@ucar.edu
>Date: Tue, 23 Nov 2004 12:21:44 -0500
>From: Chad Bahrmann <bahrmann@meteo.psu.edu>
>User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913)
>X-Accept-Language: en-us, en
>MIME-Version: 1.0
>To: ncl-talk@ucar.edu
>Content-Transfer-Encoding: 7bit
>X-Mailman-Approved-At: Tue, 23 Nov 2004 10:51:58 -0700
>Subject: gsn_polymarker multiple colors
>X-BeenThere: ncl-talk@ucar.edu
>X-Mailman-Version: 2.1.1
>List-Id: NCAR Command Language User Group <ncl-talk.ucar.edu>
>List-Unsubscribe: <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>,
<mailto:ncl-talk-request@ucar.edu?subject=unsubscribe>
>List-Post: <mailto:ncl-talk@ucar.edu>
>List-Help: <mailto:ncl-talk-request@ucar.edu?subject=help>
>List-Subscribe: <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>,
<mailto:ncl-talk-request@ucar.edu?subject=subscribe>
>X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on mscan4.ucar.edu
>X-Spam-Level:
>X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00
autolearn=unavailable version=3.0.1
>
>I am trying to get some polymarkers on a map with 3 distinct colors.
>However, I get the first and last colors requested but the second
>requested markers are ploted with the last color requested. See below.
>I get the Blue and Green but not the FireBrick.
>
> res = True
> res@mpFillOn = False ; turn off gray fill
>
> res@lbPerimOn = False
> res@mpOutlineBoundarySets = "National" ; turn on country
>boundaries
> res@mpGeophysicalLineColor = "Gray50" ; color of cont. outlines
> res@mpGeophysicalLineThicknessF = 1 ; thickness of outlines
> res@mpOutlineBoundarySets = "AllBoundaries" ; add state boundaries
> res@mpUSStateLineColor = "black" ; make them red
> res@mpUSStateLineThicknessF = 1.25 ; thickness of outlines
> res@mpDataBaseVersion = "Ncarg4_1"
> res@mpDataSetName = "Earth..2"
>
>
> res@mpMaxLatF = 43 ; choose subregion
> res@mpMinLatF = 39
> res@mpMaxLonF = -74
> res@mpMinLonF = -81
> res@gsnMaximize =True
> res@gsnDraw=False
> res@gsnFrame=False
> map = gsn_csm_map_ce(wks,res) ; draw map
> res@gsMarkerIndex = 16 ; polymarker style
> res@gsMarkerSizeF = 6 ; polymarker size
> draw(map)
> res@gsMarkerColor ="NavyBlue"
> gsn_polymarker(wks,map,anno_lon_bos,anno_lat_bos,res)
> res@gsMarkerColor ="FireBrick4"
> gsn_polymarker(wks,map,anno_lon_ssi,anno_lat_ssi,res)
> res@gsMarkerColor ="DarkGreen"
> gsn_polymarker(wks,map,anno_lon_nu,anno_lat_nu,res)
> frame(wks)
>
>
>_______________________________________________
>ncl-talk mailing list
>ncl-talk@ucar.edu
>http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-------------------------------------------------------------
Adam Phillips email: asphilli@ucar.edu
Climate and Global Dynamics Division tel: (303) 497-1726
National Center for Atmospheric Research fax: (303) 497-1333
P.O. Box 3000
Boulder, CO 80307-3000 http://www.cgd.ucar.edu/~asphilli

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



This archive was generated by hypermail 2b29 : Wed Nov 24 2004 - 09:32:08 MST