I am trying to create multiple charts in one panel. I hope for a box on both sides of the spaghetti patch.
This is an example of my code:
par(mfrow=c(1,3)) boxplot(h~y,dat, xlab="Y", ylab="Incidence 1 (percent)", main="H", scales=list(x=list(at=c(1,2)))) xyplot(H~Yr,groups=Subject,type="b",data=data, ylab="Incidence (percent)", xlab="Year", main="Incidence", scales=list(x=list(at=c(1,2)))) boxplot(h1~y1,dat1, xlab="Y", ylab="Incidence 2 (percent)", main="R", scales=list(x=list(at=c(1,2))))
When I draw my first plot, everything looks fine (the empty space is still ready for filling), but as soon as the spaghetti plot is added, the whole chart is the spaghetti chart (the box field is erased).
Is there a way to make several different graphs on the same panel?
source share