Re: [ROOT] Axis title for a TF1 function

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sat Mar 16 2002 - 11:13:53 MET


Hi Claudia,

an example:

void title() {
   TCanvas *c1 = new TCanvas("c1");
   TF1 *f1 = new TF1("f1","sin(x)/x",0,10);
   f1->Draw();
   f1->GetHistogram()->GetXaxis()->SetTitle("x axis title");
   c1->Modified();
}

Rene Brun


On Tue, 12 Mar 2002 Claudia.Tomei@mpi-hd.mpg.de wrote:

> Hi,
> I want to set the axis titles for a TF1 function in the program below:
> 
> {
>   TF1 *spec = new TF1("wimpspec",S_0,1,70,2);
>   TF1 *mspec = new TF1("wimpmod",S_m,1,70,2);
> 
> *** spec, mspec defined above ***
> 
>   c1 = new TCanvas("c1","The FillRandom example",200,10,700,700);
>   c1->SetFillColor(0);
>   pad1 = new TPad("pad1","s-zero",0.05,0.55,0.95,0.95,21);
>   pad2 = new TPad("pad2","s-m",0.05,0.055,0.95,0.45,21);
>   pad1->SetFillColor(0);
>   pad2->SetFillColor(0);
>   pad1->Draw();
>   pad2->Draw();
> 
>   pad1->cd();
>   spec->SetNpx(69);
>   spec->SetParameter(0,40.);
>   spec->FixParameter(1,17);
>   spec->Draw();
>   c1->Update();
> 
>   pad2->cd();
>   mspec->SetNpx(69);
>   mspec->SetParameter(0,40.);
>   mspec->FixParameter(1,17);
>   mspec->Draw();
>   c1->Update();
> }
> 
> I could not find any function doing that, I've tried with "GetHistogram"
> but I could not make it work. Can anybody help me?
> Thank you
> Bye
> 
> Claudia Tomei
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:46 MET