[Rd] R 'postscript' plot - not a valid postscript (PR#7559)

(Ted Harding) Ted.Harding at nessie.mcc.ac.uk
Mon Jan 24 19:45:15 CET 2005


On 24-Jan-05 Dan Bolser wrote:
> On 24 Jan 2005, Peter Dalgaard wrote:
> 
>>dan at bolser.co.uk writes:
>>> 
>>> Full_Name: Mr. Daniel Murray Bolser
>>> Version: R 2.0.0 (2004-10-04)
>>> OS: Linux beagle 2.4.20-31.9 #1 Tue Apr 13 17:38:16 EDT 2004 i686
>>> athlon i386 GNU/Linux
>>> Submission from: (NULL) (193.60.81.207)

Interestingly, using exactly the same commands with R-1.8.0
(on Linux) gives no problem. The PS in the file shows nothing
anomalous, and when displayed using 'gv' it shows the same
plot as produced by the 'plot' and 'abline' commands on their
own, with horizontal lines logarithmically positioned for the
values y=10, 20, 30, 40, 50, 60, 70, 80, 90, 100 -- i.e. it
seems that just as 'plot' ignores the "NaN" line generated by
'log10(0)' and plots the valid lines to the screen, so also
when writing to the postscript device it also ignores this line
and simply writes the valid stuff to the file.

So it would seem that plot() with postscript() has changed its
behaviour (not for the better in this case) in the passage from
1.8.0 to 2.0.0.

Best wishes,
Ted.

>>> Trying to execute the following code produces a 'not a valid
>>> postscript' error
>>> from various postscript readers (gv, ggv, ghostscript). A very
>>> similar code
>>> works fine.
>>> 
>>> <CODE>
>>> 
>>> postscript()
>>> 
>>> plot( 1:100, ylim=c(1,700), type='n', log='y')
>>> 
>>> abline(v=seq(0,100,10))
>>> abline(h=10)
>>> abline(h=seq(0,100, 10)) # Comment out this line and it works fine
>>> 
>>> dev.off()
>>> 
>>> </CODE>
>>> 
>>
>>Just abline(h=0) gives the same effect, with the following in the
>>postscript file
>>
>>77.04 nan m
>>716.61 nan l
>>
>>which of course comes from trying to calculate log10(0).
>>
>>
>>> Looking at this just now I see the problem, but if a ps file is
>>> written, it
>>> should be viewable, so I think this is still a bug.
>>
>>Yes. However, the workaround would be rather obvious...
> 
>:) 
> 
> Yup, the process of logging a bug lead me to the problem and the
> workaround was obvious. However, the hours of trying to debug were not
> so
> much fun. My script worked from within ess, but running in batch mode
> in order to prduce a ps failed. I didn't have a clue what was causing
> the
> problem, so I had to check the whole script.
> 
>>
>>
> 
> ______________________________________________
> R-devel at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 094 0861  [NB: New number!]
Date: 24-Jan-05                                       Time: 18:45:15
------------------------------ XFMail ------------------------------



More information about the R-devel mailing list