Scale up the size of my of all points in scatter p

2019-08-10 05:21发布

问题:

Is it possible to scale up the size of my of points in geom_jitter or geom_point and still have the points anchored to a size variable (in my case n)? Essentially I'd like to control all the points being smaller or larger.

I've tried increasing the values of the n variable by scaling that variable by 10 and 100, but this did not change the size of points.

library(dplyr)
library(ggplot)

mtcars %>% 
  mutate(vs = factor(vs, labels = c("V", "S"))) %>% 
  group_by(cyl, vs) %>% count() %>% 
  ggplot(aes(x = cyl, y = vs, size = n)) + 
    geom_jitter(height = .1, fill = "blue", colour = "white", pch = 21)
标签: r ggplot2