getting a TGraph from a file

From: Roger Mason <rmason_at_esd.mun.ca>
Date: Tue, 23 Jan 2007 12:00:33 -0330


Hello,

I have an elementary question: how to get a TGraph from a file.

I save a TGraph object to a file. I can open the file and verify that the TGraph is present:

root [5] TFile f("file1.txt.root","UPDATE") root [6] .ls

TFile**         file1.txt.root  
 TFile*         file1.txt.root  

  KEY: TGraph Graph;1 Original data

I recover the TGraph:

root [7] Graph->Draw()
<TCanvas::MakeDefCanvas>: created default TCanvas with name c1

but the canvas is empty.

I have tried the GetObject method with the same results.

What am I missing?

Thanks,
Roger Received on Tue Jan 23 2007 - 16:30:48 CET

This archive was generated by hypermail 2.2.0 : Tue Jan 23 2007 - 23:50:01 CET