Re: combined bar plot (distribution diagram)

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Tue Jun 03 2014 - 14:08:46 MDT

Hi Erika,
There's two things going on here:
1) The bin centers for your three bar charts are all different and each
bar chart has different bin sizes. This makes lining them up in a nice
fashion nearly impossible.
2) res@gsnXYBarChartColors does not work the way you are trying to use
it. It applies the colors set in res@gsnXYBarChartColors sequentially to
each bin. Thus, setting res@gsnXYBarChartColors =
(/"orange","red","black"/) will set the first bar of your first bar
chart orange, the second bar red, the third bar black, the fourth bar
orange and so on. It will not set the first bar chart entirely to
orange, the second to red, and the third to black.

Take a look at example #9 here:
http://www.ncl.ucar.edu/Applications/bar.shtml#ex9

Note that the input x-axis values differ for each bar chart when each of
the four plots is created.

Also note that gsn_labelbar_ndc is used to create the labelbar, and
that's the way I would recommend creating the legend using this method.
I have attached a modified version of your script along with the
resulting plot. I did not add coding to put the legend in.

Hope that helps. If you have any further questions please reply to ncl-talk.
Adam

On 06/03/2014 12:41 PM, Erika Folova wrote:
> Hallo NCL,
>
> Lately Im trying to generate a plot by combining three distributions
> (bar chart) from the output of pdf function.
> The figure that I want to have is attached (expected_figure.png). I
> experimented to try it using a simple script provided in
> example 2, but when i turn on the barchart options it seems like all
> the bars are overlapped.
> Is there any nice trick to do this kind of task (output of pdf
> function) ? I really appreciate for your nice help
>
> Best.
> Erika
>
>
> _______________________________________________
> 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/staff/asphilli



_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

pdf2.png
Received on Tue Jun 03 14:09:00 2014

This archive was generated by hypermail 2.1.8 : Sat Jun 07 2014 - 11:03:12 MDT