Skip to content
Back to formatted view

Raw Message

Message-ID: <200401170932.07487.deepayan@stat.wisc.edu>
Date: 2004-01-17T15:32:07Z
From: Deepayan Sarkar
Subject: Multiple groupedData plots in a postscript file using a loop
In-Reply-To: <20040117145857.18200.qmail@web10001.mail.yahoo.com>

On Saturday 17 January 2004 08:58, Karl Knoblick wrote:
> Hallo!
>
> I want to plot multiple grouped data in a postscript
> file using a loop. As I use a loop no plot (or just
> one empty plot) is generated. Here an example:
>
> library(nlme)
> data(Loblolly) # example data from nlme
> postscript("PSFile.ps")
> for (i in 1:1) # just as example
> {
> 	plot(Loblolly)

replace this line with 

        print(plot(Loblolly))

(plot(Loblolly) produces a ``trellis'' object, which needs to be 'print'-ed 
for anything to be actually plotted. Inside a loop (or a function), this does 
not happen unless you call print() explicitly)

> }
> dev.off()
>
> Result: Just an empty PSFile.ps.
> (Withoput the loop it works.
>
> May anybody help?
>
> Karl