Re: Fixing Colorbar

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Nov 30 2011 - 19:23:54 MST

On Nov 24, 2011, at 7:56 AM, Guilherme Martins wrote:

> Users,
>
> I want create a color bar with fixed values to each month. There is
> a link (http://www.ncl.ucar.edu/Applications/contour.shtml#ex3), but
> It's broken.

Dear Guilherme,

I'm sorry I missed this question. Several of my emails went to a weird
folder over the holiday weekend.

Where was this bad link?

I'm not sure what you mean by "fixed values to each month". Do you
mean that you want the colorbar to represent contours at exact levels,
rather than between levels?

Please see example 1 at:

http://www.ncl.ucar.edu/Applications/classification.shtml#ex1

If you want to contour based on exact values, you have to be careful
with this. NCL generates contours based on values above and below
each given contour level.

So, if you want contours at exact values 1,2,3,...,10, you need to
select contour levels that straddle these values:

     res@cnLevelSelectionMode = "Explicit"
     res@cnLevels = ispan(1,9,1) + 0.5

You can then set:

    res@lbLabelAlignement = "BoxCenters"
    res@lbLabelStrings = "" + ispan(1,10,1)

Also look at example 14 at:

http://www.ncl.ucar.edu/Applications/labelbar.shtml

--Mary

>
> My script is attach.
>
> Thanks,
>
> Guilherme.
>
> --
> Guilherme Martins
> Homepage: http://guilhermemartins.hd1.com.br/
>
>
>
> <
> VEL_200ABR
> .png
> >
> <
> VEL_200Agosto
> .png><vetor_vel1.ncl>_______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Nov 30 19:24:16 2011

This archive was generated by hypermail 2.1.8 : Fri Dec 02 2011 - 16:10:18 MST