Re: Text about binwidth below xaxis
Nick van Eijndhoven (Nick@fys.ruu.nl)
Tue, 24 Feb 1998 09:37:31 +0100 (MET)
*** Tadeusz Pytlos wrote :
>
> Hello Rooters,
> Is any easy way to place text below xaxis? Something like SetXTitle,
> but in the middle. I created histogram with methods
> ...
> TH1F *h1 = new TH1F("h1","Example",100,3,8);
> h1.SetLineWidth(2);
> h1->Fill(E);
> h1.SetXTitle("E[MeV]");
> h1.SetYTitle("N");
> h1.SetMinimum(1);
> h1.Draw();
> ...
> and I would like to insert below xaxis in the middle information
> about the width of bin of my histogram, for example text: dE=0.1 MeV,
> where 0.1 wil be automaticly changed, when I change nbins or range.
> I'm not sure if TPaveLabel or TText is the best way to use in this
> case, because I want to use this mechanism in many macros without
> changing coordinates.
> Thanks in advance
> Tadeusz
>
Dear Tadeusz,
I always just use the editor from the canvas menu to create a pavelabel.
You can create the pavelabel with your text anywhere (i.e. somwhere in the
middle) on your canvas, and then move it with the mouse to wherever you
want.
If you want to get rid of the surrounding box, just right-click on the
box border and set the bordersize to 0.
To my opinion this is the most convenient way, but maybe our 'Guru Rene'
has even a more elegant way.
Cheers,
Nick.
*----------------------------------------------------------------------*
Dr. Nick van Eijndhoven Department of Subatomic Physics
email : nick@fys.ruu.nl Utrecht University / NIKHEF
tel. +31-30-2532331 (direct) P.O. Box 80.000
tel. +31-30-2531492 (secr.) NL-3508 TA Utrecht
fax. +31-30-2518689 The Netherlands
WWW : http://www.fys.ruu.nl/~nick Office : Ornstein lab. 172
----------------------------------------------------------------------
tel. +41-22-7679751 (direct) CERN PPE Division / ALICE exp.
tel. +41-22-7675857 (secr.) CH-1211 Geneva 23
fax. +41-22-7679480 Switzerland
CERN beep : 13+7294 Office : B 160 1-012
*----------------------------------------------------------------------*