R: function to scale ggplot2, lattice or base R graph proportionally

后端 未结 2 2140
一个人的身影
一个人的身影 2021-02-08 02:13

In R I always find it annoying that base R, lattice and ggplot2 plots all work with absolute point sizes for the size of text and plot symbols.

This means that if you in

2条回答
  •  忘了有多久
    2021-02-08 02:18

    This seems to be closer to your end goal

    library(ggplot2)
    p <- qplot(Sepal.Length, Petal.Length, data = iris, 
               geom=c("point","line"),
               color = Species, size = Petal.Width, alpha = I(0.7))
    library(grid)
    print(p, vp=viewport(gp=gpar(cex=2, lex=2)))
    

提交回复
热议问题