Re: [ROOT] Reading a pad

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Nov 04 2003 - 13:48:57 MET


Hi Martin,

Assuming a canvas c1 divided into 4 pads c1_1, c1_2, etc and saved in c1.root
In a new session you can do, eg:

TFile f("c1.root")
TCanvas *c1 = (TCanvas*)f.Get("c1");
TPad *pad = (TPad*)c1->FindObject("c1_2");
TCanvas *c2 = new TCanvas("c2");
pad->Draw();
pad->SetPad(0,0,1,1);

Rene Brun

Martin Turner wrote:
> 
> Hello Root experts.
> 
> I have a Canvas, split into numerous pads, each containing a TH1F*
> histogram. The Pads will have a default name since I created them using
> TCanvas::Divide().
> I now save this plot as a root file, and start a new session.
> How do I open up this root file again, grab the third plot, for example
> and Draw it on it's own?
> 
> Has anyone any ideas?
> 
> Martin



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET