Skip to content

Saving Graphics File as .ps or .pdf (PR#10403)

17 messages · Jane_Harvill at Baylor.Edu, Uwe Ligges, Simone Giannerini +8 more

#
Full_Name: Jane L. Harvill
Version: 2.6.0
OS: Microsoft Windows XP Professional, Version 2002, Service Pack 2
Submission from: (NULL) (129.62.21.93)


PROBLEM: The ability to save the contents of an R Graphics window as a
postscript or PDf file through the drop-down menu (File -> Save As ->
Postscript, or File -> Save As -> PDF) results in the error message below being
printed to the R Console.

ERROR MESSAGE:
-----------------------------------------------------------------
Error: Invalid font type
In addition: Warning messages:
1: font family not found in PostScript font database 
2: font family not found in PostScript font database
-----------------------------------------------------------------

TO RECREATE THE PROBLEM:
1.  Using the R Console, create some graph in R; for example, plot(rnorm(100)).
2.  Select File -> Save As -> PostScript  (or File -> Save As -> PDF).
3.  Supply a file name and click the "Save" button.

FOUR OTHER RELEVANT NOTES:  
1.  I checked to see if the same error results when invoking the functions
pdf(file=...) or postscript(file=...).   No error results, and the content of
the output (.ps or .pdf) file produces a duplicate of what appears in the R
Graphics window.

2.  I checked, but did not see any other bug reports in the system that are
relevant to this problem.

3.  Before I submitted this R Bug Report, I reinstalled the PostScript fonts,
and then reinstalled R Version 2.6.0.  This did not change the outcome.

4.  This problem did not exist in previous versions of R on any of my computers.
 It exists on all computers for version 2.6.0 of R.
#
This has been reported several times before and has been fixed in 
R-patched some weeks ago.

Uwe Ligges
Jane_Harvill at Baylor.Edu wrote:
#
I have experienced the same behaviour (intermittently) on two
different WinXP machines.
Also savePlot() appears to be affected but not postscript() nor pdf()
as you mentioned.
On 11/6/07, Jane_Harvill at baylor.edu <Jane_Harvill at baylor.edu> wrote:

  
    
#
I looked at the list of bug fixes before writing and I found that the
only thing close to it is this

 o	postscript() was not always ignoring .Postscript.Options in
	the workspace (where it should not have occurred).

but I must admit I did not understand whether it had anything to do
with this bug report.

Thanks

Simone
On 11/6/07, Uwe Ligges <ligges at statistik.uni-dortmund.de> wrote:

  
    
#
On Tue, 6 Nov 2007, Simone Giannerini wrote:

            
It occurs on Windows only, and the src/gnuwin32/CHANGES file says

BUG FIXES

     o   Saving a plot to Postscript or PDF required the font database
         to have been initialized: this is now done if necessary.

See also

https://mailman.stat.ethz.ch/pipermail/r-help/2007-October/142414.html

(over a month ago).

  
    
#
Thank you,

I am sorry for my positive contribution to the entropy of R lists ...
I missed the fact that somewhere there is a separate list of Windows
specific bug fixes.
Maybe it would be useful that this list be put in evidence close to
the other one.

Kind regards

Simone
On 11/6/07, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:

  
    
#
Simone Giannerini wrote:
Well, shit happens... Never mind. Thanks for bothering in the first place.
Maybe, but given the way things have been working lately, it might be 
better to emphasize

(a) check the mailinglists
(b) try R-patched
(c) if in doubt, ask, rather than report as bug

(Ideally, people would try the prerelease versions and problems like 
this would be caught before the actual release, but it seems that they 
prefer treating x.y.0 as a beta release...)

  
    
#
The one time I did do this and complained about a change (trailing
commas now throw an error), no one responded.  But this is a rather
mild compared to the vitriolic response many (most?) "bug" reports
receive.

If you want people to report bugs, you need to provide a more
receptive atmosphere.

Hadley
#
[snip]
I am sorry but I do not agree with point (b) for the very simple fact
that the average Windows user do not know how to compile the source
code and might not even want to learn how to do it. The point is that
since (if I am correct) the great majority of  R users go Windows you
would miss an important part of potential bug reports by requiring
point (b) whereas (a) and (c) would suffice IMHO.
Maybe if there were Win binaries of the prerelease version available
some time before the release you would get much more feedback but I am
just guessing.

Regards

Simone

  
    
#
On Wed, 7 Nov 2007, Simone Giannerini wrote:

            
Windows binaries of R-patched are available all the time via
http://cran.r-project.org/bin/windows/base/

They are not always current, but only occasionally are they more than a 
day or two old.

Same for R-devel.

The biggest plus point about recommending trying R-patched is that is 
often the solution to the problem (as here, although there is also a 
workaround).

  
    
#
On Wed, 2007-11-07 at 10:51 +0100, Simone Giannerini wrote:
First I must say that patched Windows binaries are available from CRAN
with one extra click -- Linux and poor MacOS users must use 'svn co' to
check out the patched version from the repository and compile from the
sources. The attribute "poor" for MacOS users was there because this is
a bigger step for Mac users than Linux users (who can easily get and
install all tools they need and tend to have a different kind of
mentality). 

Then I must say that I do not like this policy either. I think that is
fair to file a bug report against the latest release version in good
faith without being chastised and condemned. I know (like pd says above)
that some people really do treat x.y.0 as beta releases: a friend of
mine over here even refuses to install R x.x.0 versions just for this
reason (in fact, he's pd's mate, too, but perhaps pd can talk him over
to try x.x.0 versions). Filing a bug report against latest x.x.1
shouldn't be too bad either.

I guess the problem here is that R bug reports are linked to the Rd
mailing list, and reports on "alredy fixed" bugs really are irritating.
In more loosely connected bug reporting systems you simply could mark a
bug as a duplicate of #xxxx and mark it as resolved without generating
awfully lot of mail. Then it would be humanly possible to adopt a more
neutral way of answering to people who reported bugs in latest releases.
Probably that won't happen in the current environment.

Cheers, Jari Oksanen

PS. Please Mr Moderator, don't treat me so mean (*): I've subscribed to
this group although you regularly reject my mail as coming from a
"non-member". 

(*) an extract from a classic song "Mr R jumped the rabbit".
#
Jari Oksanen wrote:
Actually, they can download

ftp://ftp.stat.math.ethz.ch/Software/R/R-patched.tar.bz2

They do have to build it (and know how to) though.

(Fedora incorporated patches in their RPM updates for a while, which I
was beginning to believe was a good idea, all things considered, but
they haven't done it (yet?) for 2.6.0.)
Of course that strategy just means that .0 becomes the alpha release and
.1 the beta....
Someone still needs to do that, manually. But yes, a new bug tracker has
been on the wish list for a while.
It is not entirely trivial to set one up, though.
#
On Nov 7, 2007, at 5:21 AM, Jari Oksanen wrote:

            
Ehm, you didn't even bother to look at the CRAN page, right?

Why am I bothering to build nightly builds of R-patched, and R-devel  
nightly and even garnishing them with a full installer so they can be  
installed just like the release version if people don't bother to read  
just a single web page ...

[Insert the usual "please do your homework" part here that may be  
considered "vitriolic" ... (vitriol is a very useful substance by the  
way ...)]

Cheers,
Simon
#
Hi Jari,

(and interested readers)
[..........................]
  [...some very good stuff...]
  [..........................]

    JO> Cheers, Jari Oksanen

    JO> PS. Please Mr Moderator, don't treat me so mean (*): I've subscribed to
    JO> this group although you regularly reject my mail as coming from a
    JO> "non-member". 

More than a year ago, I had changed R-devel policy to  

1) subscribers can post freely
2) everything else is on "hold" for moderator approval +)
3) ``spam-suspicious e-mails'' are also put "on hold".

Now your problem is that you are subscribed under a different
e-mail address than the one you are currently sending mail from
(and also use in your sig. below).
To the mailing list software (mailman) this is equivalent to a
non-subscriber.

+) the moderator can   **manually**  add non-subscriber
   addresses to a list which is treated as "allowed to post"
   and I could do this next time ...
   but my general attitude is that r-devel subscribers should
   make these things work...

Best regards,
Martin

    JO> (*) an extract from a classic song "Mr R jumped the rabbit".
    JO> -- 
    JO> Jari Oksanen <jari.oksanen at oulu.fi>
#

        
JO> On Wed, 2007-11-07 at 10:51 +0100, Simone Giannerini wrote:
>> [snip] (this is from pd = Peter Dalgaard)
    >> > Maybe, but given the way things have been working lately, it might be
    >> > better to emphasize
    >> >
    >> > (a) check the mailinglists
    >> > (b) try R-patched
    >> > (c) if in doubt, ask, rather than report as bug
    >> >
    >> > (Ideally, people would try the prerelease versions and problems like
    >> > this would be caught before the actual release, but it seems that they
    >> > prefer treating x.y.0 as a beta release...)
    >> >
    >> 
    >> I am sorry but I do not agree with point (b) for the very simple fact
    >> that the average Windows user do not know how to compile the source
    >> code and might not even want to learn how to do it. The point is that
    >> since (if I am correct) the great majority of  R users go Windows you
    >> would miss an important part of potential bug reports by requiring
    >> point (b) whereas (a) and (c) would suffice IMHO.
    >> Maybe if there were Win binaries of the prerelease version available
    >> some time before the release you would get much more feedback but I am
    >> just guessing.

    JO> First I must say that patched Windows binaries are available from CRAN
    [............]

    JO> Then I must say that I do not like this policy either. I think that is
    JO> fair to file a bug report against the latest release version in good
    JO> faith without being chastised and condemned. 

I agree in principle.
If you do that without any of [abc] above, you do produce a bit
of work to at least one R-core member who has to deal with the
bug report (in the jitterbug archive) in addition to the usual
time consumption (of someone answering) which is unavoidable and
hence ok.

I think we as R developers should more graciously accept such
false positives in order to get more true positives...


    JO> I know (like pd says above) that some people really do
    JO> treat x.y.0 as beta releases: a friend of mine over here
    JO> even refuses to install R x.x.0 versions just for this
    JO> reason (in fact, he's pd's mate, too, but perhaps pd can
    JO> talk him over to try x.x.0 versions). Filing a bug
    JO> report against latest x.x.1 shouldn't be too bad either.

well, given past experience, I think people *should* adopt  c)
in such and more cases, i.e. rather "ask" than "report a bug",
also in light of what you say below, but when people don't, they
still should be handled politely ..

    JO> I guess the problem here is that R bug reports are linked to the Rd
    JO> mailing list, and reports on "alredy fixed" bugs really are irritating.
    JO> In more loosely connected bug reporting systems you simply could mark a
    JO> bug as a duplicate of #xxxx and mark it as resolved without generating
    JO> awfully lot of mail. Then it would be humanly possible to adopt a more
    JO> neutral way of answering to people who reported bugs in latest releases.
    JO> Probably that won't happen in the current environment.

    JO> Cheers, Jari Oksanen

Martin Maechler
#
Dear Martin, Jari, et al.,

Another relevant point (which I haven't seen in this discussion -- perhaps I
missed it) is that one can read the CHANGES and NEWS files on CRAN without
downloading or installing R-patched.

Regards,
 John
#
There is a simple solution to this kind of problem - for my
non-day-job-related software stuff, I usually subscribe under
my sourceforge address. Sourceforge's is simple re-direction service
so I actually cannot post from it; but I like incoming e-mails to go
through sourceforge for a double spam filter. So e-mails come in through
sourceforge but replied under my real address if I do, and it get held
occasionally in the past depending on the mailing list policies.

The solution I found is this: subscribe both addresses, but disabling 
delivery to the real-one. (this can be done by the user, no admin 
required). This way I can post from the real one, but receive 
twice-filtered mailing-list e-mails through an alias.

(For R-devel, I am receiving and posting from my day-job address,
if you are wondering...)
Martin Maechler wrote: