Search code examples
ggplot2geom-point

ggplot geom_point make the points bigger when using aes


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))

Solution

  • 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