[ncl-talk] histogram plot

Mary Haley haley at ucar.edu
Mon Oct 24 13:05:35 MDT 2016


Sitan,

Please be aware that ncl-talk emails are going to hundreds of users, so
it's better not to specifically address NCL developers in a new email
thread.

I would start by looking at our histogram examples:

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

and in particular, examples histo_6.ncl and histo_11.ncl

To add the text and lines to the plot, use gsn_add_text and
gsn_add_polyline. You can see example histo_16.ncl for this.

Note that in order to get the X locations for your lines and strings, you
may want to use the special BeginBarLocs, MidBarLocs, or EndBarLocs
attributes that are returned when you create a histogram using
gsn_histogram.

These attributes are necessary because the X axis values that you see
(-2.2, -1.8, -1.4, etc) are not X locations, but rather bin ranges for your
data. The three special attributes will give you the X locations for your
bars so you can more easily position your text and lines where you want
them.

--Mary


On Mon, Oct 24, 2016 at 8:18 AM, Sitan Heyl <heylsitan at gmail.com> wrote:

> Hi, Mary
>    I remember there is one example how to plot histogram like this
> (attachment). can you give me some suggestion how to plot it?
>
> Best,
> Yongli
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161024/bd846859/attachment.html 


More information about the ncl-talk mailing list