Re: Control over colorbar

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Dec 19 2013 - 12:00:18 MST

Hi,

The labelbar examples page is a good place to visit for questions regarding customizing a labelbar.

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

For the min/max labels, see example lb_10.ncl, and in particular, the "cnLabelBarEndLabelsOn" resource.

For formatting the labels themselves, see lb_7.ncl

Example lb_7.ncl says that you can't format the labels apriori, but this is not exactly true.

If you know what your contour levels are before you create the plot, then you can format
these levels using "sprintf", and set "lbLabelStrings" equal to this.

For example, let's say you are setting the contour levels with:

res@cnLevels = fspan(5.82,24.87,26)

Then you can set the labelbar strings with something like:

res@lbLabelStrings = sprintf ("%5.2f",res@cnLevels)

As a side note: I noticed you have what appears to be "times-roman" as your font.
This indicates you are running an older (6.0 or earlier) version of NCL. We
recommend using the "helvetica" font which looks better for publication.

To get helvetica, you can do one of two things:

  - Upgrade to NCL V6.1.2, in which "helvetica" is the default font.

  - Create a ".hluresfile" that goes in your home directory, and set
     the font there. For more info, see:

     http://www.ncl.ucar.edu/Document/Graphics/hlures.shtml

--Mary

On Dec 18, 2013, at 8:01 PM, Fernando Magariņos Lamas <mancha@mac.com> wrote:

> Hello, I'd like to have the min and max values on the color bar on the
> label below the color bar and all the values printed with at most 2
> decimal digits. Is it possible?
>
>
> --
> Saludos.
>
>
> <nntemperatura_prueba.png>_______________________________________________
> 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 Thu Dec 19 12:00:44 2013

This archive was generated by hypermail 2.1.8 : Mon Jan 06 2014 - 13:02:23 MST