[ROOT] TLatex vs. TPad vs. TH1F vs. TPaveStats

From: Kevin M. Rhodes (kmr@alizarin.physics.wisc.edu)
Date: Sat Jul 08 2000 - 00:05:22 MEST


Hello all.

I've been working on a macro to do a crude visual analysis of sets of
histograms, and I've finally found myself to be stuck.  The problem
consists mostly of formatting the layout of my histograms, so perhaps this
seems trivial. Here's a snippet, with problem in tow:

TCanvas *canvas = new TCanvas(var1, var2, 700, 550);
TLatex *tInfo = new TLatex();
tInfo->DrawLatex(.5, .95, "Info");
TPad pMain ("pmain", "main pad", 0,0,1,.90);
pMain->Draw();
pMain->cd();
pMain->Divide(2,2);
pMain->cd(1);
TH1F *h1 = (TH1F*)f1->Get(var3);
h1->Draw();
h1->Fit("myfunction");
TLatex *t1 = new TLatex();
t1->DrawLatex(.01, .95, "text in question");

Now, I want the t1 TLatex to position itself between the top of the
histogram and the top of the pad.  However, no matter what values I give
to DrawLatex, it puts the text in the bottom left corner of the histogram
(mind you, not in the bottom left corner of the pad).  I thought that
maybe pads within pads, or histograms and Latex don't get along, or a
number of other unmentionable things.  Also, I know that this can be
done via mouse and editor, but I need to automate this for several
hundred files. Any ideas?


Even if there is a way to do that, what I'd really like to do is put my
three lines of text (which are in t1) into the TPaveStats pave.  So, is
there any way to add those lines to the pave? Can I delete the
TPaveStats pave, create a new pave, and pass in my text along with, say,
Mean and RMS? 

Any help, as always, is most appreciated.

Kevin Rhodes
UW-Madison
AMANDA group

 



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:29 MET