在ggplot2中设置绘图区域的大小

时间:2015-06-04 16:35:56

标签: r ggplot2

是否可以使用ggplot2直接指定绘图区域的宽度和高度,例如3"和4"对于下图?

enter image description here

示例代码:

library(ggplot2)
x <- seq(-5,5,by=.1)
d <- data.frame(x=x,y=cos(x))
p <- ggplot(d) + aes(x=x,y=y) + geom_line()
ggsave(p,file='~/example.pdf')

0 个答案:

没有答案
相关问题