Skip to content

Default value for title in postscript()

5 messages · Martin Maechler, Patrick Connolly, Peter Kleiweg +1 more

#
[ This really should have gone to R-devel instead of R-help.
  I'm now diverting -- and please leave off "R-help" when replying again.
]
PaCo> I like the fact that the postscript function enables
    PaCo> the possbiility of a more useful title than before.
    PaCo> However, I'd prefer the default to be the file name.

    PaCo> It's very simple for me to make my own postscript
    PaCo> function that does just that simply by setting title =
    PaCo> file.  I always use onefile = TRUE, so it always works
    PaCo> (so far).  However, I'm a little reluctant to do that
    PaCo> in case some future changes cause conflicts.  I've
    PaCo> been warned off tinkering with .Internal

    PaCo> My question is: What is the tidiest way of doing such
    PaCo> a thing?  Should I make a private function that calls
    PaCo> the standard postscript function, 

yes, your own function calling the standard high-level postscript(),
not some low-level {.Internal(), .Call(), .C() or .For..... } --
these all may be changed "without notice" !}

    PaCo> or should I go the whole hog and make an S4 type method to handle it?

    PaCo> Or would it be simpler for the standard function to be changed

certainly simpler for you.. ;-)

I tend to agree that a change might be useful --
For the new default, I'd actually go further and propose
something like (when file = "Rplots.ps")

   "Rplots.ps [from R 1.7.0]"

    PaCo> (assuming, of course, there aren't good reasons
    PaCo> against doing that)?

Unfortunately, there's a good reason: back-compatibility.
In spite of that, I do advocate a change.

Martin
#
On Wed, 23-Apr-2003 at 09:52AM +0200, Martin Maechler wrote:
|> 
|> [ This really should have gone to R-devel instead of R-help.
|>   I'm now diverting -- and please leave off "R-help" when replying again.
|> ]
|> 
|> >>>>> "PaCo" == Patrick Connolly <p.connolly@hortresearch.co.nz>
|> >>>>>     on Wed, 23 Apr 2003 10:08:00 +1200 writes:

|>     PaCo> My question is: What is the tidiest way of doing such
|>     PaCo> a thing?  Should I make a private function that calls
|>     PaCo> the standard postscript function, 
|> 
|> yes, your own function calling the standard high-level postscript(),
|> not some low-level {.Internal(), .Call(), .C() or .For..... } --
|> these all may be changed "without notice" !}
|> 
|>     PaCo> or should I go the whole hog and make an S4 type method to handle it?
|> 
|>     PaCo> Or would it be simpler for the standard function to be changed
|> 
|> certainly simpler for you.. ;-)
|> 
|> I tend to agree that a change might be useful --
|> For the new default, I'd actually go further and propose
|> something like (when file = "Rplots.ps")
|> 
|>    "Rplots.ps [from R 1.7.0]"

Sounds like a good idea though I always specify a file name myself.

|> 
|>     PaCo> (assuming, of course, there aren't good reasons
|>     PaCo> against doing that)?
|> 
|> Unfortunately, there's a good reason: back-compatibility.
|> In spite of that, I do advocate a change.

In general, back-compatibility is important, but in this case, who
would be inconvenienced by not having the same '%%Title:' line in all
their postscript files?  Someone more experienced might be able to
imagine a case.  I can't.

I was toying with the idea of setting up a perl script that would run
through all my postscript files and change the %%Title: line so I can
tell what file I'm looking at with ghostview.  It won't be necessary
with any new ones, so I'll probably do some of the other things I
haven't got round to instead.

best
#
# aldus Patrick Connolly :
If you want to do it properly, add something like this comment:

%%Creator: R : Copyright 2003, The R Development Core Team, Version 1.7.0  (2003-04-16)

Leave out the %%Title comment, unless the user specifies a title.

Adding a %%CreationDate comment might be useful.
#
On Wed, 23 Apr 2003, Martin Maechler wrote:

            
I'm lost here!

Most people don't care what the title is, and I left it as previous
versions gave.  Why would anyone want the title in the file to default to 
the file name, which in any case defaults to something anodyne?

There's a general R principle here: the person who does the work gets to 
choose the details.  Patrick: if you had submitted a comprehensive patch, 
you might have got to choose!
3 days later
#
On Thu, 24-Apr-2003 at 06:56PM +0100, Prof Brian Ripley wrote:

        
|> On Wed, 23 Apr 2003, Martin Maechler wrote:
|> 
|> > 

|> > I tend to agree that a change might be useful --
|> > For the new default, I'd actually go further and propose
|> > something like (when file = "Rplots.ps")
|> > 
|> >    "Rplots.ps [from R 1.7.0]"
|> > 
|> >     PaCo> (assuming, of course, there aren't good reasons
|> >     PaCo> against doing that)?
|> > 
|> > Unfortunately, there's a good reason: back-compatibility.
|> > In spite of that, I do advocate a change.
|> 
|> I'm lost here!
|> 
|> Most people don't care what the title is, and I left it as previous
|> versions gave.  Why would anyone want the title in the file to default to 
|> the file name, which in any case defaults to something anodyne?

There is only one reason I can think of and that's so it is shown in
the title bar of ghostview.  That's a pretty good one.  I never use
default filenames, so the name in the title bar is always informative
if it's the filename.  All my postscript files created by R are in
places where it's obvious they're R Graphics Output.  That might not
be the case for other people.


|> 
|> There's a general R principle here: the person who does the work
|> gets to choose the details.  Patrick: if you had submitted a
|> comprehensive patch, you might have got to choose!

I looked at it, and noticed I'd have to do things with the .Internal
PS function (and I'd been warned off going there).  I asked the R-help
list how complicated it would be and was promptly notified that it had
been changed in the R-devel.  That's one of the neat things about R:
things happen quickly.

I'm not complaining.  It's simple enough for me to work with how it
is.  There was a possibility that other people might think my way of
working wasn't so wierd so that a change to the default might be
desirable.  I never use onefile = FALSE so there could be issues that
complicate matters in a way I'm unaware of.

best