... Moved from R-help ...
Thank you for your suggestion, Professor Ripley. Postscript does seem
like the way to go for printing line widths correctly in Windows.
On Linux I am using a simple dev.print() wrapper (as suggested), with a
pipe to lpr.
However, I had an extremely difficult time getting postscript printing
under windows.
?postscript recommends the RedMon suite of tools for printing PS files
to printers. I had no trouble installing and using this utility from my
shell, but under R, I observed this odd behavior:
options(printcmd='redpr')
plot(1:10)
dev.print(file = "Rplots.ps", print.it = TRUE)
dev.off()
## Nothing happens!!
q()
## Now it prints
That is, the file only prints when the R session is closed, and not when
the device is closed (contrary to the documentation). After some head
banging, I changed the printcmd options to lpr (the one that comes with
Windows XP), and the PS file printed out correctly after the dev.off()
command. If other people observe this behavior with Windows / RedMon,
then perhaps Windows lpr is the better tool.
Either way, I'm happy to now have beautiful Windows plots again on both
my R screen and R printer.
Thanks,
Robert
-----Original Message-----
From: Prof Brian Ripley [mailto:ripley@stats.ox.ac.uk]
Sent: Tuesday, February 08, 2005 12:10 PM
To: McGehee, Robert
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Windows Printing and Line Widths
Those printers AFAIK support postscript.
How are you printing to them on Linux? I suggest you use dev.print
under
Windows (it needs some setup, see ?postscript). That makes more sense
than going via PDF as the support is all already in R and it is AFAIK
the
printer's native mode.
We've seen far too many problems with HP Windows printer drivers on 8000
and 4000 series printers.
On Tue, 8 Feb 2005, McGehee, Robert wrote:
> Hi all,
> I develop and print from both Windows and Linux, and am seeing some
> printing inconsistencies first described about a year and a half ago
by> Andy Liaw (see below). Specifically, the line widths on my windows
plots> are about 5 times smaller than that on Linux, and my windows printouts
> do not match what my screen looks like. However, if I print to a pdf
> file first, then I can get accurate Windows reproduction of my screen.
I> was thinking of writing a windows.print() wrapper that creates a
> temporary pdf file and then prints that. However, I wanted to see if a
> better solution now exists to get identical printouts on both Linux
and> Windows (since Andy's original post), or any comments on what printers
> this does or does not affect.
>
> Thanks,
> Robert
>
> HP Laserjet 8150DN
> HP Color Laserjet 4600DN
> HP Laserjet 4050TN
>
> platform i386-pc-mingw32
> arch i386
> os mingw32
> system i386, mingw32
> status
> major 2
> minor 0.1
> year 2004
> month 11
> day 15
> language R
>
> ---------------------------------
> From: Prof Brian Ripley
> Date: Mon Jun 23 2003 - 23:59:29 EDT
>
>
> What printer driver are you using?
>
>
> I've just tried this and it works exactly as one would expect on my HP
> 970CXi, as well as cut-and-paste into other applications. It also
worked>
> printing to Acrobat Distiller (although all the lines were thinner
there>
> than on-screen and on the 970CXi, the ratio was still 1:5).
>
>
> We've been here before, and had to abandon some optimizations because
of> a
> bug in interpreting Windows metafiles in Word.
>
>
> On Mon, 23 Jun 2003, Sundar Dorai-Raj wrote:
>
>
>> Andy,
>> I've experienced the same thing. What's interesting is that
printing
>> a plot (CTRL-P) with lwd = 25 makes lines on the hardcopy look like
> lwd
>> = 5. I'm using R1.7.1 on Win2000Pro.
>>
>> Regards,
>> Sundar
>>
>> Liaw, Andy wrote:
>>> Dear R-help,
>>>
>>> Has anyone notice the problem that, on Windows (NT and XP), when
> printing a
>>> graph using the "File -> Print..." menu in the
graphics window to
> print the
>>> graph, that line width seemed to be ignored in the printed output?
> For
>>> example, if I make a plot with plot(1:10, type="l",
lwd=5), it looks
> right
>>> on screen, but when printed out using the menu, it looks like the
> plot was
>>> made with lwd=1. I've had this problem for quite a while (at
least
> since
>>> 1.3.x) and still present in 1.7.1. Has anyone else seen this, or
> just me?
>>>
>>> Best,
>>> Andy
>>>
>>> Andy Liaw, PhD
>>> Biometrics Research PO Box 2000, RY33-300
>>> Merck Research Labs Rahway, NJ 07065
>>> mailto:andy_liaw@merck.com <mailto:andy_liaw@merck.com>
732-594-0820
>
>>>
>>>
>>>
>>>
>
------------------------------------------------------------------------> ------
>>> Notice: This e-mail message, together with any attachments, cont...
> {{dropped}}
>>>
>>> ______________________________________________
>>> R-help@stat.math.ethz.ch mailing list
>>> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>>>
>>
>> ______________________________________________
>> R-help@stat.math.ethz.ch mailing list
>> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>>
>
>
> --
> Brian D. Ripley, ripley@stats.ox.ac.uk
> Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
> <http://www.stats.ox.ac.uk/%7Eripley/>
> University of Oxford, Tel: +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UK Fax: +44 1865 272595
>
>
> Robert McGehee
> Geode Capital Management, LLC
> 53 State Street, 5th Floor | Boston, MA | 02109
> Tel: 617/392-8396 Fax:617/476-6389
> mailto:robert.mcgehee@geodecapital.com
>
>
>
> This e-mail, and any attachments hereto, are intended for
us...{{dropped}}>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html>
--
Brian D. Ripley, ripley@stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595