Skip to content
Back to formatted view

Raw Message

Message-ID: <40C3CC3B.5020406@pdf.com>
Date: 2004-06-07T02:00:27Z
From: Spencer Graves
Subject: Printing Lattice Graphs from Windows
In-Reply-To: <jsh7c059ooia32cgrsr54p4fdesq4cd3l3@4ax.com>

Hi, Duncan: 

      Thanks.  It worked for me, complete with the gray background and 
pastel blue dot.  The following also worked to eliminate the (to me 
ugly) gray background, etc.: 

win.metafile()
trellis.par.set('background', list('white'))
trellis.par.set('plot.symbol',
  list(cex=0.8, col="blue", font=1, pch=1))
xyplot(1 ~ 1)
dev.off()

      Thanks again.  spencer graves

Duncan Murdoch wrote:

>On Sun, 06 Jun 2004 17:43:42 -0700, Spencer Graves
><spencer.graves at pdf.com> wrote:
>
>  
>
>>Hi, Deepayan: 
>>
>>     Following your suggestion, I tried the following in Rgui.exe: 
>>
>>    
>>
>>>xyplot(1~1)
>>>win.metafile()
>>>graphics.off()
>>>      
>>>
>>     I then switched to MS Word, pasted, and got the same blank plot as 
>>before.  (I actually tried other things as well, but came to this after 
>>reading the documentation.) 
>>    
>>
>
>You should open the device *first*.  Then you plot to it, then close
>it and the graphics are saved.
>
>That is,
>
>  
>
>>library(lattice)
>>win.metafile()
>>xyplot(1 ~ 1)
>>dev.off()
>>    
>>
>
>This worked for me in a single attempt; I haven't tested it
>thoroughly.
>
>Generally speaking, you get better graphics results by plotting to the
>final graphics device rather than plotting to the screen and copying
>somewhere, because the graphics system makes some choices based on the
>target device capabilities, and those choices might not be appropriate
>on a different device.  I notice lines are often too thin when printed
>from a plot on screen, for example.
>
>Duncan Murdoch
>  
>