Hi Ed,
After hnew->SetTitle("My Title");
add
hnew->Draw();
or, do
TH2F *hnew = new TH2F("hnew","My Title",100,0,10,100,0,20);
pT->Draw("a:b>>hnew");
Rene Brun
On Mon, 30 Jun
2003, Ed Oltman wrote:
> Hello,
>
> I would like to create a histogram using TTree::Draw() and then
> change the title:
>
> The following code snipped does not display "My title"
>
> TTree *pT = pointer to a tree
>
> pT->Draw("a:b>>hnew(100,0.,10.,100,0.,20.)");
> TH2F *hnew = (TH2F *)gDirctory->Get("hnew");
> hnew->SetTitle("My title");
>
> It does not change the title. hnew->GetTitle() returns "My title", but
> I can't seem to get it to display.
>
> I'm guided here by the following does which does display "My title":
>
> pT->Draw("a:b")
> TH1F *htemp = gPad->Get("htemp")
> htem->SetTitle("My title")
>
> I am using win32 version of root 3.05/3 on Win2k. Thanks
>
> Ed Oltman
>
>
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:12 MET