Re: browserable graph

From: Otto Schaile (Otto.Schaile@Physik.uni-muenchen.de)
Date: Thu Dec 23 1999 - 13:06:48 MET


On Thu, 23 Dec 1999, C. Bernet wrote:

> Aihong Tang wrote:
> 
> > Hi,
> >
> > How to make a graph visible and drawable just like a
> > histogram in the Browser?

You can write a graph as all TObjects to ROOT file. 
Modify $ROOTSYS/tutorials/graph.C as follows: 

   gr->GetHistogram()->SetXTitle("X title");
   gr->GetHistogram()->SetYTitle("Y title");

// write TGraph to file

   TFile f("graph.root","RECREATE");
   gr->Write();
   f.Close();
}

Then open the file with the TBrowser, get the list of contents, 
double click on Graph;1 
and you should see the graph.

Cheers
Otto
----------------------------------------------------------------------------
Otto Schaile                    Sektion Physik der LMU Muenchen
Phone: (+49 89)289 14070        Am Coulombwall 1, D-85748 Garching, Germany
FAX:   (+49 89)289 14072        EMail: Otto.Schaile@Physik.Uni-Muenchen.DE



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:44 MET