Re: [ROOT] Questions about Bar Charts

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue May 07 2002 - 15:16:31 MEST


Hi Tony,

This is a complement to my previous answer

Rene Brun

Colley, Tony wrote:
> 
> When I draw a Bar Chart (I am using TH1 with draw option "bar2"), is there a
> way to specify that the bars should be drawn from 0 (zero) rather than from
> the minimum Y value. That is, I would like bins with positive values to be
> drawn as bars extending from the X axis upwards, and bins with negative
> values to be drawn as bars extending from the X axis downwards.
> 

This is now implemented (by default) in the CVS head.


> Also, is it intentional that combining "barX" (where X>0) with "P" or "C" or
> "L" would cause the histogram to look like I used "bar0" -- that is, the
> dark & light edges are not drawn, or are drawn with width=0 (which is
> effectively the same thing)?


The barX option should not be used (currently) with other options like 
"c","l","p". To get what you want, proceed as indicated in the example
below

void bar2() {
   TCanvas *c1 = new TCanvas("c1");
   TH1F *h = new TH1F("h","h",20,-4,4);
   h->FillRandom("gaus",500);
   h->SetFillColor(50);
   h->SetLineColor(4);
   h->SetLineWidth(4);
   h->SetMarkerStyle(21);
   h->DrawCopy("bar2");
   h->SetFillColor(0);
   h->Draw("cp same");
}

> 
> Thanks,
> Tony
> 
> +------------------------------------------------+
> | Tony Colley                ITT Industries A/CD |
> | Modeling/Simulation Group  Fort Wayne, IN  USA |
> +------------------------------------------------+
> | Using ROOT 3.03/04 on RedHat Linux 7.2         |
> | Last CVS update: 29 Apr 2002 at 13:23 GMT      |
> +------------------------------------------------+
> \I'm not responsible for anything below this line/
> 
> ************************************
> If this email is not intended for you, or you are not responsible for the
> delivery of this message to the addressee, please note that this message may
> contain ITT Privileged/Proprietary Information.  In such a case, you may not
> copy or deliver this message to anyone.  You should destroy this message and
> kindly notify the sender by reply email.  Information contained in this
> message that does not relate to the business of ITT is neither endorsed by
> nor attributable to ITT.
> ************************************



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:52 MET