Dear All:
I have a 2 by 2 plots per page (4 plots/page) for total 12 pages (48 IDs) generated by the below example codes. How do I specify a title at the top center of each page and add a legend in the middle center of each page. I know mtext can add title and legend can add legend, but my problem is how to add them to each page (12 pages) not each plot (48 plots, 4 plots/page).
par(mfrow=c(2,2),mar=c(5,5,4,4))
for (i in unique(tak700$ID)){
j=tak700$ID==i
plot(tak700$TIME[j], tak700$DV[j], type='n', xlim=c(0,max(tak700$TIME[j])), ylim=c(0,max(tak700$DV[j],tak700$IPRE[j],tak700$PRED[j])),xlab='Time(hr)', ylab='Plasma Concentration(ng/ml)',cex=0.8)
lines(tak700$TIME[j], tak700$DV[j], type='b', col=2, pch=1, lwd=2, lty=4, cex=0.9)
}
But how and where to add the below example commands to generate title and legend per page for total 12 pages?
legend(80,10,col=6,lty=c(1,4),c('Predicted median','Predicted 95% PI'),lwd = 2,cex=1.1,bty='n')
mtext(outer=T, 'Phase II at steady state', side=3, line=-2,cex=1.2,col=2)


雷达卡





京公网安备 11010802022788号







