See an example in $ROOTSYS/tutorials/graph.C. In particular look at the
comments:
//Add axis titles.
//A graph is drawn using the services of the TH1F histogram class.
//The histogram is created by TGraph::Paint.
//TGraph::Paint is called by TCanvas::Update. This function is called
by default
//when typing <CR> at the keyboard. In a macro, one must force
TCanvas::Update.
c1->Update();
c1->GetFrame()->SetFillColor(21);
c1->GetFrame()->SetBorderSize(12);
gr->GetHistogram()->SetXTitle("X title");
gr->GetHistogram()->SetYTitle("Y title");
c1->Modified();
Rene Brun
On Tue, 29 May 2001, Chia Ming,Kuo wrote:
> Dear all,
>
> I use root 2.25/02.
> I can use histo1->GetXaxis()->SetTitle("X-Axis") in histogram.
> But when I employ this to TGraphErrors (gr->GetXaxis()->SetTitle("X-Axis")),
> I fail. There is a segmentation error message.
> Why couldn't I use it in TGraphErrors ?
>
> Thanks for your help !
>
> Sincerely,
> Chia Ming
>
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:47 MET