0

In ggplot I want to make the geom_points bigger overall when they are in an aes. For example:

ggplot(diamonds %>% head(30)) +
  geom_point(aes(x = cut, y=color, size=carat))

Gives exactly the same plot as

ggplot(diamonds %>% head(30)) +
  geom_point(aes(x = cut, y=color, size=10*carat))

size of points don't change with 10*

You can do this outside the aes, but it doesn't work within

ggplot(diamonds %>% head(30)) +
  geom_point(aes(x = cut, y=color), size=10))
pluke
  • 3,832
  • 5
  • 45
  • 68
  • 3
    Whenever you pass something inside `aes()`, it gets mapped to a scale, which typically rescales it to some output range, i.e. `c(1, 6)` for `scale_size_continuous()`. You can set that size larger in the scale if you want. For a scale, it doesn't matter that the input range is [0-100] or [-1e6, 1e6], the output will be according to the output range. – teunbrand Feb 01 '23 at 10:15
  • ah, lovely, adding ` + scale_size(range = c(0, 40))` solved this – pluke Feb 01 '23 at 10:21

1 Answers1

0

From @teunbrand comment:

ggplot(diamonds %>% head(30)) +
  geom_point(aes(x = cut, y=color, size=carat)) +
  scale_size(range = c(0, 40))

larger sized aes points

pluke
  • 3,832
  • 5
  • 45
  • 68