Re: Stat font size using Portrait mode in TPostScript

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Oct 18 1999 - 17:03:39 MEST


Hi Alberto,
You have one important line missing in your macro, the one that
should create the canvas.
I have added this line in your macro below and the ps file is identical
to what you have on the screen.
Note that when you create a TPostScript object yourself, Root uses
the screen aspect ratio for Postscript. In your case you require
a Postscript paper size of 20x26 cm. I create therefore a canvas with
the same aspect ratio.
Note that Root version 2.23 includes several improvements regarding text 
aligment and size.

Rene Brun

Alberto Baldisseri wrote:
> 
> Hi rooters,
>     I am trying to plot 12 histograms using "Portrait" mode in
> TPostScript in a output file.
> I would like to plot all the fit information for each plot , so I put
> the OptStat and OptFit
> to the desired value, but I get too big fonts for the stat printing and
> also for the title
> on the PostScript file produced. I can not suceed to reduce the font
> size.
>     gStyle->SetTextSize dont work. I try also
> gPad->GetPrimitive("stats") without
> success. There is maybe a trivial way to do it .... Any ideas are
> welcome.
>     I am using ROOT 2.22/10 on a Linux RH6.0.
> 
> Best regards,
> 
> Alberto
> 
> PS : I attach to this message the macro I use and the root file
> containning my histograms
> 
> --
> +-------------------------------+------------------------------------+
> | Alberto BALDISSERI            | Tel : (33-1) 69 08 93 33           |
> | DAPNIA/SPhN, Bat 703 pièce 42 | Fax : (33-1) 69 08 75 84           |
> | CEA Saclay                    | E-mail : a.baldisseri@cea.fr       |
> | F 91191 Gif-sur-Yvette cedex  |                                    |
> +-------------------------------+------------------------------------+
> 
>   ------------------------------------------------------------------------
> 
>                     Name: tbsim.root
>    tbsim.root       Type: unspecified type (application/octet-stream)
>                 Encoding: base64
> 
>   ------------------------------------------------------------------------
> //
> // Some histos
> //
> void fit()
> {
>   gROOT->Reset();
    TCanvas *myc = new TCanvas("myc","myc",600,600*26/20);
//<===========
>   gStyle->SetOptStat(111111);
>   gStyle->SetOptFit(1111);
>   gStyle->SetTextSize(0.02);  // DONT'T WORK !!!
>   TFile *histofile = new TFile("tbsim.root");
>   TPostScript *psfile = new TPostScript("tb.ps",111);
>   psfile->Range(20,26);
>   myc->Divide(2,6);
>   myc->cd(1);
>   bfitg.Fit("gaus");     // b fit global
>   bfitg.Draw();
>   myc->cd(2);
>   bfitlr.Fit("gaus");    // b fit letf
>   bfitlr.Draw();
>   myc->cd(3);
>   yrefg.Fit("gaus");     // fit global - MC
>   yrefg.Draw();
>   myc->cd(4);
>   yreflr.Fit("gaus");    // fit left - MC
>   yreflr.Draw();
>   myc->cd(5);
>   ytml.Fit("gaus");      // track model left
>   ytml.Draw();
>   myc->cd(6);
>   ytmr.Fit("gaus");      // track model right
>   ytmr.Draw();
>   myc->cd(7);
>   yreftmr.Fit("gaus");   // track model left - MC
>   yreftmr.Draw();
>   myc->cd(8);
>   yreftml.Fit("gaus");   // track model right - MC
>   yreftml.Draw();
>   myc->cd(9);
>   ytmlr.Fit("gaus");     // track model left/right
>   ytmlr.Draw();
>   myc->cd(10);
>   yreftmlr.Draw();
>   yreftmlr.Fit("gaus");  // track model left/right - MC
>   myc->cd(11);
>   yrefmc.Fit("gaus");    // Y MC proto
>   yrefmc.Draw();
>   psfile->Close();
> }



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:41 MET