Re: attaching label bar

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed, 1 Mar 2006 15:26:17 -0700 (MST)

Hi Julie,

You are approaching the NCL big leagues with a question like this. :-)

Adding annotations to NCL is possible, and it allows you to attach the
annotation to any side of the plot, and then move it in or out so that
you can have it be inside the plot, outside the plot, etc. If
you resize the plot, the labelbar will be resized accordingly.

There's a function that you use to do this, called
"NhlAddAnnotation". Please see the "examples" section in the page:

http://www.ncl.ucar.edu/Document/Functions/Built-in/NhlAddAnnotation.shtml

You're in luck because this page actually shows how to attach a
labelbar. However, it uses the objected oriented method to create the
labelbar, rather than the "gsn_labelbar_ndc" procedure.

I'm guessing that you are using "gsn_labelbar_ndc", no? You need to
have the id of the labelbar returned so you can attach it to the
plot. gsn_labelbar_ndc doesn't give you this, but you can use an
undocumented *function* that is identical, except it is a function
instead of a procedure. It is called "gsn_create_labelbar_ndc" and it
takes the same arguments in the same order:

    lbidl = gsn_create_labelbar_ndc(wks,nboxes,labels,x,y,res)

You can then use "lbid" as the second argument to "NhlAddAnnotation".

Note to all: I think "gsn_create_labelbar_ndc" was added in the last
version of NCL, and I haven't documented yet. If you need access to it
and it doesn't seem to be in your current version of NCL, let me know.

Note to Julie: I will email you personally with a "gsun-ized" version
of the example that's in the above URL.

--Mary

On Wed, 1 Mar 2006, Julie Schramm wrote:

> Hi,
>
> How do I attach my "homemade" label bar to a plot? I'd like to do this so
> that the plot "knows" about it and will make some room.
> Thanks,
>
> Julie
>
>
> --
>> Julie L. Schramm
>> National Center for Atmospheric Research
>> Research Applications Laboratory ph. (303) 497-2834
>> P. O. Box 3000 fax (303) 497-8401
>> Boulder, CO 80307-3000 E-mail schramm_at_ucar.edu
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Mar 01 2006 - 15:26:17 MST

This archive was generated by hypermail 2.2.0 : Wed Mar 01 2006 - 15:47:46 MST