# Setting A DiLog Axis

Hi all!

I would like to scale my data to the DiLog on a TGraph to be able to compare large and small values with potentially positive and negative numbers along the y axis. I would like this with the appropriate scale in y in factors of 10 as when one performs Canvas->SetLogy(). However, I do not know how to replace the main axes.

This is what I have so far:

``````Double_t y = {-1.E-3, 1.E5, -1.E4, 1.E-6, -1.E-2};
Double_t y_scaled;
Double_t x = {1, 2, 3, 4, 5};
TF1 * f_dl = new TF1 ("f_dl", "TMath::DiLog(x)", -1.E5, 1.E5 );

for (int var_i = 0; var_i<5; var_i++){
y_scaled[var_i] = TMath::DiLog(y[var_i]);
std::cout<<y_scaled[var_i]<<std::endl;
}

TGraph * g = new TGraph (5, x, y_scaled);
TCanvas *c2 = new TCanvas("c2","c2",10,10,700,500);
TGaxis *axis_dl = new TGaxis(0,0,10,0,"f_dl",505,"");
g->SetMarkerStyle(10);
g->Draw("AP");
axis_dl->Draw("same");

``````

I have tried to use the examples provided in  but sadly, I have not been able to get these to work.

Can anyone point me in the right direction?

Kind Regards,

Jack

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

DrawFrame and graph drawing with option “AP” are conflicting. The option “A” redefining the axis. And the coordinates defined by DrawFrame are ignored.

``````{
Double_t y = {-1.E-3, 1.E5, -1.E4, 1.E-6, -1.E-2};
Double_t y_scaled;
Double_t x = {1, 2, 3, 4, 5};
TF1 * f_dl = new TF1 ("f_dl", "TMath::DiLog(x)", -1.E5, 1.E5 );

for (int var_i = 0; var_i<5; var_i++){
y_scaled[var_i] = TMath::DiLog(y[var_i]);
std::cout<<y_scaled[var_i]<<std::endl;
}

TGraph * g = new TGraph (5, x, y_scaled);
TCanvas *c2 = new TCanvas("c2","c2",10,10,700,500);