Hi Ulrich, Ulrich, I cannot understand what you try to do! My assumption is that you have a TEmbeddedCanvas already paint. Why do you create another TCanvas ? Why not to do simply: { gROOT->SetStyle("print");// contains SetHeaderPS("175 850 translate"); // to put the plot on top centered TPostScript ps("jostps.ps", 111); ps.Range(18, 18); ps.NewPage(); embcanvas->GetCanvas()->UseCurrentStyle(); embcanvas->GetCanvas()->Draw(); // annotation->Paint(); // a TPavetext object c1->Update(); ps.Close(); delete c1; } The examples given at http://root.cern.ch/root/HowtoPS.html work correctly. Rene Brun Ulrich Jost wrote: > > Hi, > > I try to create a postscript file with a plot (TCanvas) above and a > TPavetext below. > The following sequence does not work properly. If I watch the file > in ghostview, the stuff appears for half a second, but then is > deleted and I have a white space. > Anyone knows how to do it correctly within a program (not a macro)? > I took the below from root's HOWTO's. > I attach the ps file. Somehow the stuff is there... > > Thanks, Ulrich > > gROOT->SetStyle("print");// contains SetHeaderPS("175 850 translate"); > // to put the plot on top centered > TCanvas *c1 = new TCanvas("c1"); > TPostScript ps(sout1.str(), 111); > ps.Range(18, 18); > c1->Divide(1, 2); > ps.NewPage(); > c1->cd(1); > > embcanvas->GetCanvas()->UseCurrentStyle(); > embcanvas->GetCanvas()->Draw(); > c1->Update(); > c1->cd(2); > annotation->Paint(); // a TPavetext object > c1->Update(); > ps.Close(); > delete c1; > > ------------------------------------------------------------------------ > > Name: temp1848993626.ps > temp1848993626.ps Type: Postscript Document (APPLICATION/postscript) > Encoding: BASE64
This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:33 MET