Re: [ROOT] How can I save different plots in a single ps file?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Apr 08 2002 - 12:53:49 MEST


Hi Bernard,

You are right. This use case was not supported.
I have added a new option (see below) in the current CVS version
to support this mode.
//
//   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");
//    

Also note that you can use the pad context menu "SaveAs" for the first and
last picture and use the canvas pulldown menu "saveAs canvas.ps" for
all the intermediate pictures. We will incorporate these options in
the GUI Print dialog in a coming version.

Rene Brun

Bernard Andrieu wrote:
> 
> Hello,
> 
> during a root session, I would like to save some (but not all) of the
> plots I'm making on the screen on a single ps file. Furthermore, I want
> to decide to save a given plot only AFTER I've seen it.
> 
> Reading the root documentation, I've found :
> - how to save a single plot on a ps file, but it creates as many ps
> files as there are plots
> - how to save many pictures in a single ps file (in the "How to use the
> PostScript interface" web page), but you need to know BEFORE which plot
> you want to save.
> so none of these methods answers my question.
> 
> In PAW, I used to do that very simply. I had put in my pawlogon.kumac
> the following two lines:
> 
> FORTRAN/FILE 66 ./paw.ps
> ALIAS/CR ops 'exec ~/paw/paw#PRTPOST'
> 
> and I had a paw.kumac containing the following macro:
> 
> MACRO
> PRTPOST
>   META -66 -111
>   PIC/PLOT ' '
>   META 0
> RETURN
> 
> then I only had to do "ops" at the command line to do what I want.
> 
> Since it's not possible to do simpler, can anybody tell me how to do at
> least as simple as that in ROOT?
> 
> Thank you,
>       Bernard Andrieu



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