R Scale plot elements within PDF of set width and height

前端 未结 4 376
刺人心
刺人心 2021-02-02 10:46

Though R plots sent to a PDF can be rescaled at will in an illustration or page layout software, scientific journals often insist that the plots provided have specific dimension

4条回答
  •  长情又很酷
    2021-02-02 11:45

    Oddly enough, you can do this with scale= in ggsave(...)

    require(ggplot2)
    p <- qplot(data=iris, x=Petal.Width, y=Petal.Length, colour=Species)
    ggsave("test.1.pdf",p)
    ggsave("test.2.pdf",p, width=3, height=3, units="in", scale=3)
    

    Try playing with the scale parameter and see what you get...

提交回复
热议问题