Dear List members,
I am trying to produce some trellis graphics and to save them in a
postscript file but I only get blank files. R behaviour is certainly
strange because I use a loop to generate the graphics (see code below).
When I change the loop variable myself the postscript graphics are OK.
I am using R 1.9.1 (2004-06-21) on Debian GNU/Linux which I try to keep
updated on a daily basis. I am aware of some problems in R 1.9.0 but
I don't know if it has been fixed yet. And nobody mentioned problems
with loops.
Any ideas? Thanks in advance.
Best regards,
Virgilio
for(centre in 1:3)
{
for(method in 1:12)
{
auxdata<-
as.data.frame(t(table.thres[c(method,16),1+(centre-1)*250+(1:250)]))
names(auxdata)<-c("Threshold",
"Parameters")
trellis.device(postscript,
file=paste("plots/thresold-",method,"-",centre,".eps",
sep=""),
onefile=FALSE, color=TRUE)
bwplot(Threshold~Parameters, data=auxdata,
groups=Parameters,
main=list(label=get.method(method), cex=1.5),
horizontal=FALSE, pch=".",
scales=list(cex=1.5),
par.strip.text=list(cex=1.5))
dev.off()
}
}
On Thu, 24 Jun 2004, Virgilio G??mez Rubio wrote:> I am trying to produce some trellis graphics and to save them in a > postscript file but I only get blank files. R behaviour is certainly > strange because I use a loop to generate the graphics (see code below). > When I change the loop variable myself the postscript graphics are OK. > > I am using R 1.9.1 (2004-06-21) on Debian GNU/Linux which I try to keep > updated on a daily basis. I am aware of some problems in R 1.9.0 but > I don't know if it has been fixed yet.It has. See the NEWS file.> And nobody mentioned problems with loops.They are mentioned frequently. You have to explicitly print lattice plots, such as bwplot. See ?Lattice.> Any ideas? Thanks in advance. > > Best regards, > > Virgilio > > > > for(centre in 1:3) > { > for(method in 1:12) > { > > auxdata<- > > as.data.frame(t(table.thres[c(method,16),1+(centre-1)*250+(1:250)])) > > names(auxdata)<-c("Threshold", "Parameters") > > trellis.device(postscript, > file=paste("plots/thresold-",method,"-",centre,".eps", sep=""), > onefile=FALSE, color=TRUE) > > > bwplot(Threshold~Parameters, data=auxdata, > groups=Parameters, > main=list(label=get.method(method), cex=1.5), > horizontal=FALSE, pch=".", scales=list(cex=1.5), > par.strip.text=list(cex=1.5)) > dev.off() > } > }-- Brian D. Ripley, ripley at 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
Try print(bwplot(...YOUR PARAMETERS...)) Best wishes, Karl> > Dear List members, > > > > I am trying to produce some trellis graphics and tosave them in a> postscript file but I only get blank files. Rbehaviour is certainly> strange because I use a loop to generate thegraphics (see code below).> When I change the loop variable myself thepostscript graphics are OK.> > > I am using R 1.9.1 (2004-06-21) on Debian GNU/Linuxwhich I try to keep> updated on a daily basis. I am aware of someproblems in R 1.9.0 but> I don't know if it has been fixed yet. And nobodymentioned problems> with loops. > > > Any ideas? Thanks in advance. > > > Best regards, > > > Virgilio > > > > > for(centre in 1:3) > { > for(method in 1:12) > { > > > auxdata<- > >as.data.frame(t(table.thres[c(method,16),1+(centre-1)*250+(1:250)]))> > > names(auxdata)<-c("Threshold","Parameters")> > > trellis.device(postscript, >file=paste("plots/thresold-",method,"-",centre,".eps", sep=""),> onefile=FALSE, color=TRUE) > > > > bwplot(Threshold~Parameters,data=auxdata,> groups=Parameters, >main=list(label=get.method(method), cex=1.5),> horizontal=FALSE, pch=".",scales=list(cex=1.5),>par.strip.text=list(cex=1.5))> dev.off() > } > } > >___________________________________________________________ Bestellen Sie Y! DSL und erhalten Sie die AVM "FritzBox SL" f??r 0. Sie sparen 119 und bekommen 2 Monate Grundgeb??hrbefreiung.