[R] Printing ps pictures with transparent b'ground

About this list Date view Thread view Subject view Author view Attachment view

From: Peter Dunn (dunn@usq.edu.au)
Date: Thu 06 May 2004 - 14:54:33 EST


Message-id: <4099C509.8020703@usq.edu.au>

Hi all

I wish to create a ps file of a picture produced in R.
With my limited R, I see two ways:
1. Print direct to the postscript device
2. Print to the screen, and save to ps using dev.print.

I want a white (not transparent) background. Option
1 above works fine, but 2 does not: even when I say I
want a white background, I get transparent; perhaps I
misread the help files.

Here's some R code:

### Method 1
### - print straight to postscript device
postscript(horizontal=FALSE,
        onefile=FALSE,
        bg="white",
        width=4,
        height=4,
        paper="special",
    file="testfile.eps" )
curve( dnorm, from=-3, to=3)

dev.off()

### Method 2
### - print to screen, and save using postscript

x11(width=4, height=4)
curve( dnorm, from=-3, to=3)

dev.print( postscript,
    horizontal=FALSE,
        onefile=FALSE,
        bg="white",
        width=4,
        height=4,
        paper="special",
    file="testfile2.eps" )

I then want to place these files in a LaTeX prosper document
for a presentation. A typical (minimal) prosper file is:

\documentclass[pdf,colorBG,slideColor,whitecross]{prosper}

\begin{document}

\begin{slide}{Print to \textsc{ps} direct}
\includegraphics{testfile.eps}
\end{slide}

\begin{slide}{Print to screen first}
\includegraphics{testfile2.eps}
\end{slide}

\end{document}

The whitecross class provides a blue background for the
presentation. testfile.eps appears with a white background
on the slides, but testfile2.eps has a transparent
background.

I'd apprecaite if someone could explain why the two are not equivalent,
or how I can coerce the second option to have a white background? Or
even explain my misunderstandings (assuming (with high probability)
that I have some).

Thanks.

P.

> version
          _
platform i686-pc-linux-gnu
arch i686
os linux-gnu
system i686, linux-gnu
status
major 1
minor 8.1
year 2003
month 11
day 21
language R

-- 
Dr Peter Dunn          (USQ CRICOS No. 00244B)
   Web:    http://www.sci.usq.edu.au/staff/dunn
   Email:  dunn @ usq.edu.au
Opinions expressed are mine, not those of USQ.  Obviously...

______________________________________________ R-help@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:07 EST