Hi, anybody know why this not works for several plots ? When i set onefile=T the plots are stacked one about another , onefile=F only the first plot is shown in AllbusMeansPlots.svg. [h2 is a data.frame] ......hist and sapply works for several plots nice with RSvgDevice ! Maybe setting the title after apply is a problem, but until yet i didn't found a better solution ? library(RSvgDevice) library(gregmisc) devSVG(file = "AllbusMeanPlots.svg", width = 10, height = 8, bg = "lightblue", fg = "white", onefile=T, xmlHeader=TRUE) #par(bg="lightblue",ann=T) plt <- function(x) { plotmeans(h2[,x] ~ h2$V174,ylab=names(h2)[x],xlab="InglehartIndex",mean.labels=T, connect=list(1:2,3:4,4:5),ccol="red",pch=7,barwidth=1,barcol="black") title("Mittelwert-Plots Allbus 1998") } sapply((2:ncol(h2)),plt) dev.off() Thanks for advance christian
...hist didn't works,too. Wrong remind, but with pdf() the sapply functions work ! christian ----- Original Message ----- From: "Christian Schulz" <ozric at web.de> To: <r-help at stat.math.ethz.ch> Cc: <jake.luciani at riskmetrics.com> Sent: Friday, December 27, 2002 11:20 AM Subject: [R] RSvgDevice & sapply(plotmeans)> Hi, > anybody know why this not works for several > plots ? > When i set onefile=T the plots are stacked one about another > , onefile=F only the first plot is shown in AllbusMeansPlots.svg. > [h2 is a data.frame] > ......hist and sapply works for several plots nice with RSvgDevice ! > Maybe setting the title after apply is a problem, but until yet i didn't > found a better solution ? > > library(RSvgDevice) > library(gregmisc) > devSVG(file = "AllbusMeanPlots.svg", width = 10, height = 8, > bg = "lightblue", fg = "white", onefile=T, xmlHeader=TRUE) > #par(bg="lightblue",ann=T) > plt <- function(x) { > plotmeans(h2[,x] ~ > h2$V174,ylab=names(h2)[x],xlab="InglehartIndex",mean.labels=T, > connect=list(1:2,3:4,4:5),ccol="red",pch=7,barwidth=1,barcol="black") > title("Mittelwert-Plots Allbus 1998") > } > sapply((2:ncol(h2)),plt) > dev.off() > > > Thanks for advance > christian > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help
I'll try fixing the problem shortly. Thanks for the feedback. Jake On Fri, 2002-12-27 at 05:20, Christian Schulz wrote:> Hi, > anybody know why this not works for several > plots ? > When i set onefile=T the plots are stacked one about another > , onefile=F only the first plot is shown in AllbusMeansPlots.svg. > [h2 is a data.frame] > ......hist and sapply works for several plots nice with RSvgDevice ! > Maybe setting the title after apply is a problem, but until yet i didn't > found a better solution ? > > library(RSvgDevice) > library(gregmisc) > devSVG(file = "AllbusMeanPlots.svg", width = 10, height = 8, > bg = "lightblue", fg = "white", onefile=T, xmlHeader=TRUE) > #par(bg="lightblue",ann=T) > plt <- function(x) { > plotmeans(h2[,x] ~ > h2$V174,ylab=names(h2)[x],xlab="InglehartIndex",mean.labels=T, > connect=list(1:2,3:4,4:5),ccol="red",pch=7,barwidth=1,barcol="black") > title("Mittelwert-Plots Allbus 1998") > } > sapply((2:ncol(h2)),plt) > dev.off() > > > Thanks for advance > christian