Re: TGraph Qs and problems
Rene Brun (Rene.Brun@cern.ch)
Thu, 10 Sep 1998 19:23:03 +0200
Stephen Bailey wrote:
> 
> Hi.
> 
> How do I put X and Y axis labels on a TGraph?  I tried
> 
>   gr->GetXaxis()->SetLabel("dE/dx cut");
>   gr->Draw("AC");
> 
> but no axis label appeared.
> 
> Also, when I plot a new graph to a prexisting canvas, the
> axes numbers come out all garbled.  If I do a c1->Clear()
> first, then the TGraph plots fine.
> 
Stephen,
Use SetTitle not Setlabel.
See an example in $ROOTSYS/tutorials/graph.C
Set the title after gr->Draw.
TGraph::Draw does not clear the pad by default.
Rene Brun