r - set size of a plot area in ggplot2 -


is there way directly specify width , height of plot area ggplot2, example 3" , 4" figure below?

enter image description here

sample code:

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') 

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()  pdf(file="example.pdf", width=3, height=4) p dev.off() 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -