Re: [ROOT] problem in Y axis description

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Apr 19 2002 - 18:20:33 MEST


Jacek,

It is a pity that you cannot send a real example.
Anyhow, there are many recipees to circumvent this possible problem
 - change the axis label size
 - Call TAxis::setNoExponent
 - call pad->SetTopMargin
 - gStyle->SetTitleX(0.15);  //move title to the right

Rene Brun

 
Jacek M. Holeczek wrote:
> 
> Hi,
> 
> > Could you send me a script showing the problem?
> 
> Well I could, but you wouldn't be able to use it anyhow.
> In principle I just :
>         gROOT->SetStyle("Plain"); // postscript files will be printed
>         // gStyle->SetTitleBorderSize(1); // SOLVES THE 10^-x PROBLEM !!!
> then I create and draw my TCanvas and 8 TPads :
>         TCanvas *cE = new TCanvas("cE", "cE");
>         TPad *padE1 = new TPad("padE1", "padE1", 0.0, 0.75, 0.5, 1.0);
>         // ...
>         TPad *padE8 = new TPad("padE8", "padE8", 0.5, 0.0, 1.0, 0.25);
>         padE1->SetGrid(); padE1->Draw();
>         // ...
>         padE8->SetGrid(); padE8->Draw();
>         cE->Update();
> then in every padE? I draw my padE? specific TGraphs/TMultiGraphs :
>         TPaveText *p = (TPaveText *)0; // used later to change the title
>         TString s; // used later to change the title
>         // ...
>         padE?->cd(); cE->Modified(); cE->Update();
>         mgE250->DrawClone("A"); // TMultiGraph - gives axises and default title
>         MaxMinATEVac250SM?->Draw("F"); // padE? specific TMultiGraph
>         AllATEVac250SM?->Draw("L"); // another padE? specific TMultiGraph
>         padE?->Update();
>         if ((p = ((TPaveText *)(gPad->FindObject("title")))) != 0)
>           {
>             s = "Modified padE? title";
>             p->Clear(); p->InsertLine(); p->InsertText(s);
>           }
>         padE?->Modified(); // we are ready with padE?
> and finally I :
>         cE->Update();
>         cE->SaveAs("cE.ps");
> Nothing special as you can see (the "gif" file, that I have sent you, was
> grabbed from a "gv cE.ps" window - the problem is much more visible in
> postscript files than in the TCanvas itself).
> 
> > You can circumvent this problem with:
> >   -pad->SetTopMargin(0.15);
> >   -hist->GetYaxis()->SetNoExponent()
> 
> A simple general solution that I actually use is :
>         gStyle->SetTitleBorderSize(1);
> 
> Best regards,
> Jacek.



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