我用spie()
函数做了一些图表,现在我希望它们在一个页面上。我知道如何使用layout()
函数将页面拆分为足够的行和列。但总是当我运行spie()
函数时,spie图表不在"矩阵方案中#34;但在整个页面?任何想法为什么会这样?
在我的代码下面:
require(caroline) # edited
par(mar=c(3,3,3,3))
layout(matrix(c(1,2,3,4,5,6,7,8), 4, 2, byrow = FALSE))
p1=c(0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09)
p2=c(4, 16, 17, 11, 10, 16, 6, 9, 18, 1, 11)
spie(p1,p2, bg="white", grid=FALSE, p1.circle=FALSE, pie.labs=FALSE,
col=c("red", "darkorange", "yellow", "olivedrab2", "limegreen",
"aquamarine", "royalblue1", "mediumblue", "slateblue3",
"hotpink", "mediumvioletred"))