Re: [ROOT] Empty postscript files

From: Valeriy Onuchin (Valeri.Onoutchine@cern.ch)
Date: Mon Mar 29 2004 - 12:18:28 MEST


Hi Marc,
I do not see this problem with ROOT 4.10.03

Regards. Valeriy

> Hi,
> 
> The Canvas now remains, but the PS file is still empty,
> unfortunately. Also, in the Plot() macro the postscript
> file is closed before the canvas goes out of existence,
> so I would not expect this to matter.
> 
> Cheers,
> Marc
> 
> -----Ursprungliche Nachricht-----
> Von: Olivier Couet [mailto:Olivier.Couet@cern.ch]
> Gesendet: Montag, 29. Marz 2004 11:02
> An: Marc de Kamps
> Cc: roottalk@pcroot.cern.ch
> Betreff: Re: [ROOT] Empty postscript files
> 
> 
> 
> Hi,
> 
> I do not see  the problem on linux (PS file is ok) but the Canvas is 
> closed immediately after execution. This is because you do not use 
> pointers. May be on windows the PS file is not created. Anyway, try this 
> version:
> 
> void DumpCanvas()
> {
>    gROOT->Reset();
>    TCanvas *c1 = new TCanvas("c1","Example",200,10,700,500);
> 
>    TH1F *h1 = new TH1F("h1","wysiwyg",100,0,1);
>    h1->Fill(0.5,1);
>    h1->Draw();
>    c1->Print("Equally_beautiful_histo.ps"); 
> }
> 
> Cheers,        O.Couet
> 
> 
> On Mon, 29 Mar 2004, Marc de Kamps wrote:
> 
> > Hi,
> > 
> > Both macros below create empty ps files.
> > This is 3.10/02 under win2000 (win32gdk version).
> > What to do ?
> > 
> > Thanks,
> > Marc
> > 
> > 
> > 
> > void Plot()
> > {
> > gROOT->Reset();
> > 
> > TCanvas c1;
> > 
> > TPostScript ps("Beautiful_histo.ps",111);
> > TH1F h1("h1","wysiwyg",100,0,1);
> > h1.Fill(0.5,1);
> > h1.Draw();
> > 
> > c1.Update();
> > 
> > ps.Close();
> > }
> > 
> > void DumpCanvas()
> > {
> > gROOT->Reset();
> > 
> > TCanvas c1;
> > 
> > TH1F h1("h1","wysiwyg",100,0,1);
> > h1.Fill(0.5,1);
> > h1.Draw();
> > 
> > c1.Update();
> > 
> > c1.Print("Equally_beautiful_histo.ps");
> > } 
> > 
> > 
> 
> -- 
> Org:    CERN - European Laboratory for Particle Physics.
> Mail:   1211 Geneve 23 - Switzerland                     Mailbox: 
> J25910      
> E-Mail: Olivier.Couet@cern.ch                            Phone:   
> +41 22 7676522
> WWW:    http://cern.ch/Olivier.Couet/                    Fax:     
> +41 22 7677155
> 
> 
> 



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:07 MET