Re: please help with color bar

From: H.Dang <danghy_at_nyahnyahspammersnyahnyah>
Date: Tue Aug 16 2011 - 14:01:56 MDT

Hi Adam,

Thank you. I've got the white one. When using "transparent", I got:

warning:_NhlGetGksCi:Invalid Color index=-1

Then the final box color is set to black, maybe default.

Cheers
Hongyan
2011/8/16 Adam Phillips <asphilli@ucar.edu>

> Hi Hongyan,
> lbBoxLineColor = "white"
>
> http://www.ncl.ucar.edu/Document/Graphics/Resources/lb.shtml#lbBoxLineColor
>
> I'm not sure if transparent will work, but you can give it a shot by
> setting the above resource to "transparent" or -1 ...
> Adam
>
> On 08/16/2011 01:34 PM, H.Dang wrote:
> > Hi Adam,
> >
> > Thanks for your help. Finally I got one in the attachment. Could you
> > also please tell me how to make the black lines between the colors
> > transparent or white? Thanks again.
> >
> > Hongyan
> > On Tue, Aug 16, 2011 at 11:46 AM, Adam Phillips <asphilli@ucar.edu
> > <mailto:asphilli@ucar.edu>> wrote:
> >
> > Hi Hongyan,
> > No, there is no automatic way to do this. If you want to use all 200
> > colors from the BlAqGrYeOrReVi200 colormap, and you want the middle
> > color
> > (representing -.01:.01) to be white, you will have to set that up
> > manually:
> >
> > colors = new(201,integer)
> > colors(:99) = ispan(2,101,1)
> > colors(100) = 0 ; or -1 if you truly want transparent
> > colors(101:) = ispan(102,201,1)
> > res@cnFillColors = colors
> >
> > You would also have to set cnLevels explicitly to whatever you'd
> like.
> > Finally, if you truly want to use all 200 colors in your labelbar,
> > you're
> > probably going to want to set lbLabelStride = 10 (or somewhere > 10),
> as
> > this will reduce the number of label bar labels to every 10th
> label...
> > Hope that helps.. Adam
> >
> > > Hi dear all,
> > >
> > > My current color bar is like the attachment. The NCL code I'm
> > using is:
> > >
> > > gsn_define_colormap(wks,"BlAqGrYeOrReVi200")
> > > res = True
> > > res@mpFillOn = False ;
> > > turn map fill off
> > > res@mpOutlineOn = True ;
> > > turn the map outline on
> > > res@cnLevelSelectionMode = "ExplicitLevels" ;
> > > set explicit contour levels
> > > res@cnFillOn = True ;
> > > turn on color fill
> > > res@cnLinesOn = False ;
> > > turn off the contour lines
> > > res@cnLevels = (/ -5., -1, -0.01, 0.01,1, 5, 10, 15.,20, 25, 30,
> 35,
> > > 40, 45, 50/) ; set levels
> > > res@cnFillColors =
> > > (/2,16,31,0,56,63,75,84,96,106,115,127,139,150,165,175,191,201/)
> > ; set the
> > > colors to be used
> > >
> > > My question is if I can use as many as possible colors, say all
> > the color
> > > in
> > > "BlAqGrYeOrReVi200", and keep the -0.01 and 0.01 labels in the
> > color bar,
> > > the others can be automatically generated. Since the transparent
> > color
> > > (white) between -0.01~0.01 is very important for me, I must keep
> > them.
> > > Appreciate your help!
> > >
> > > Have a good day.
> > > --
> > > Cordially,
> > > Hongyan(鸿雁)
> > > Tel: 1-519-8884567ext36667 <tel:1-519-8884567ext36667>
> > > _______________________________________________
> > > ncl-talk mailing list
> > > List instructions, subscriber options, unsubscribe:
> > > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> > >
> >
> >
> > __________________________________________________
> > Adam Phillips asphilli@ucar.edu <mailto:asphilli@ucar.edu>
> > NCAR/Climate and Global Dynamics Division
> > P.O. Box 3000 (303) 497-1726 <tel:%28303%29%20497-1726>
> > Boulder, CO 80307-3000
> > http://www.cgd.ucar.edu/cas/asphilli
> >
> >
> >
> >
> > --
> > Cordially,
> > Hongyan(鸿雁)
> > Tel: 1-519-8884567ext36667
> >
> >
> >
> >
> > _______________________________________________
> > 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
>

-- 
Cordially,
Hongyan(鸿雁)
Tel: 1-519-8884567ext36667

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Aug 16 14:02:26 2011

This archive was generated by hypermail 2.1.8 : Mon Aug 22 2011 - 08:13:37 MDT