justinian482
justinian482

Reputation: 1075

Change size of geom_point based on values in column

I have plotted data with geom_point and the size of the data point is set by the the values in a column. I want to increase the overall size of these points ( and also keeping the relative sizes). I have tried to just multiply all the values with a number, but the point sizes stay the same. How can I increase the overall point size? enter image description here

Upvotes: 5

Views: 7392

Answers (1)

Dan Adams
Dan Adams

Reputation: 5264

Modify the range in scale_size() or if you prefer scale_radius()

library(tidyverse)

mtcars %>% 
  ggplot(aes(x = disp, y = hp)) +
  geom_point(aes(size = mpg), alpha = 0.5) +
  scale_size(range = c(5, 10))

Created on 2021-03-16 by the reprex package (v1.0.0)

Upvotes: 7

Related Questions