RE: arrhenius plot with customised axis

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Tue, 26 May 2009 13:05:01 +0200


The following macro show how to produce an axis (axis A2) using a function:  

{

gStyle->SetOptStat(0);  

TH2F *h2 = new TH2F("h","Axes",100,0,10,100,-2,2);

h2->Draw();  

TF1 *f1=new TF1("f1","-x",-9.87,9.47);

TGaxis *A1 = new TGaxis(0,2,10,2,"f1",510,"-");

A1->SetTitle("axis with decreasing values"); Draw();  

TF1 *f2=new TF1("f2","exp(x)",0,2.342);

TGaxis *A2 = new TGaxis(1,1,9,1,"f2",510,"-");

A2->SetTitle("exponential axis");

A2->SetLabelSize(0.03);

A2->SetTitleSize(0.03);

A2->SetTitleOffset(1.2);

A2->Draw();  

TF1 *f3=new TF1("f3","log10(x)",1,1000); TGaxis *A3 = new TGaxis(2,-2,2,0,"f3",505,"G");

A3->SetTitle("logarithmic axis");

A3->SetLabelSize(0.03);

A3->SetTitleSize(0.03);

A3->SetTitleOffset(1.2);

A3->Draw();

}    

From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch] On Behalf Of Bastian Schnitzler
Sent: Tuesday, May 26, 2009 12:58 PM
To: roottalk_at_root.cern.ch
Subject: [ROOT] arrhenius plot with customised axis  

Hi all!
I want to plot an arrhenius plot with a logharitmic y-axis, which is no problem. But then I want two x-axes: One with 1/x and another one (maybe at the top of the graphics pad) with x, so people can easily read values of x and y, but still seeing a linear slope.

Is that possible in root?

Yours,
Bastian Received on Tue May 26 2009 - 13:05:08 CEST

This archive was generated by hypermail 2.2.0 : Tue May 26 2009 - 17:50:04 CEST