Re: [ROOT] How do I suppress the canvas ?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Feb 01 2002 - 08:29:50 MET


Hi Harufumi,

You can run in batch mode:
  root -b
  root > .x mymacro.C

or switch off/on teh batch mode in your session
  root > gROOT->SetBatch(kTRUE);
  root > .x mymacro.C

Rene Brun

Harufumi Tsuchiya wrote:
> 
> Hi ROOTers,
> 
> I would like to create many postscript files without
> showing canvas on display.
> What method or option shuld I use to do this ?
> 
> Now, I did following precedure in my program.
> In this case, postscript files were created. But,
> canvas also appeared on display.
> 
> I use ROOT v 3.02/07 on IRIX65 with g++ 2.95.2.
> 
> Thank you for your help.
> 
> TCanvas *c1;
> Int_t nDiv  = 996;
> Int_t istep = 12;
> Int_t pad_num = 0;
> Int_t sch, ech;
> 
> for ( Int_t i = 0; i < nDiv; i = i + istep) {
>     sch = i; ech = i + istep;
>     pad_num = 0;
>     c1 = new TCanvas("c1", "", 100, 100, 600, 800);
>     c1->Divide(3, 4);
>     for ( Int_t j = sch; j  < ech; j++ ) {
>       c1->cd(pad_num+1);
>       h1[j]->SetXTitle("number of particles");
>       h1[j]->SetLineColor(2);
>       h1[j]->Draw("");
>       gPad->Modified();
>       gPad->Update();
>       pad_num++;
>     }
>     c1->Update();
>     sprintf(psfile, "ps/ch%d-ch%d_NumOfParDist.ps",  sch, ech);
>     c1->Print(psfile);
>     cout << " Create ps file : " << psfile << endl;
>     c1->Clear();
> }



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