Skip to content
Prev 385849 / 398503 Next

How to decrease size of points?

Hello,

Your example is not reproducible but here it goes.

Data:

df1 <- iris[c(1, 2, 5)]

Use scale_size_manual.

1. If Stage is a factor or character



df1$Stage <- "a"

p <- ggplot(df1, aes(Sepal.Length, Sepal.Width, color = Species))
p1 <- p +
   geom_point(aes(size = Stage), alpha = 1/3) +
   xlab ("X") +
   ylab("Y") +
   geom_smooth(method = 'loess', formula = y ~ x)



2. If Stage is numeric, coerce to factor manually


df1$Stage <- 5

p <- ggplot(df1, aes(Sepal.Length, Sepal.Width, color = Species))
p1 <- p +
   geom_point(aes(size = factor(Stage)), alpha = 1/3) +
   xlab ("X") +
   ylab("Y") +
   geom_smooth(method = 'loess', formula = y ~ x)


Then add the scale_size


p1 + scale_size_manual(values = 0.8)


Hope this helps,

Rui Barradas

?s 16:05 de 30/09/20, Medic escreveu: