You have too many calls to ps->NewPage(); I recommend using the procedure described in TPad::Print. Writing several canvases to the same Postscript file // ---------------------------------------------------- // if the Postscript file name finishes with "(", the file is not closed // if the Postscript file name finishes with ")" and the file has been opened // with "(", the file is closed. Example: // { // TCanvas c1("c1"); // h1.Draw(); // c1.Print("c1.ps("); //write canvas and keep the ps file open // h2.Draw(); // c1.Print("c1.ps"); canvas is added to "c1.ps" // h3.Draw(); // c1.Print("c1.ps)"); canvas is added to "c1.ps" and ps file is closed // } // // Note that the following sequence writes the canvas to "c1.ps" and closes the ps file.: // TCanvas c1("c1"); // h1.Draw(); // c1.Print("c1.ps"); // // The TCanvas::Print("file.ps(") mechanism is very useful, but it can be // a little inconvenient to have the action of opening/closing a file // being atomic with printing a page. Particularly if pages are being // generated in some loop one needs to detect the special cases of first // and last page and then munge the argument to Print() accordingly. // // The "[" and "]" can be used instead of "(" and ")". Example: // // c1.Print("file.ps["); // No actual print, just open file.ps // for (int i=0; i<10; ++i) { // // fill canvas for context i // // ... // // c1.Print("file.ps"); // actually print canvas to file // }// end loop // c1.Print("file.ps]"); // No actual print, just close. Rene Brun On Thu, 29 May 2003, Stilianos Kesisoglou wrote: > Hi, > > I am using the code that I am attaching to create PostScript file with a number of plots. > > My problem is that the ps file turn out to have on every other page a blank one. > > I know that I must do something silly but I can't find what. > > Any help would be appreciated. > > Thanks! > > Stelios.
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:12 MET