Increase minimum point size in ggplot geom_point

I am using the following data and code:

> 
> dput(ddf)
structure(list(xx = c("aa", "bb", "cc"), gp = c("one", "two", 
"one"), yy = c(5L, 10L, 15L)), .Names = c("xx", "gp", "yy"), class = "data.frame", row.names = c(NA, 
-3L))
> 
> 
> ddf
  xx  gp yy
1 aa one  5
2 bb two 10
3 cc one 15
> 
> ggplot(ddf)+geom_point(aes(x=xx, y=yy, size=gp))
> 

      

enter image description here

The smaller dot size is very small and hardly noticeable here. It becomes even more obscure if it is colored. Can I enlarge a smaller size so that I can see it clearly?

+3


source to share


1 answer


You will need to use the parameter range

internally scale_size_discrete

, for example:

ggplot(ddf) +
  geom_point(aes(x=xx, y=yy, size=gp)) +
  scale_size_discrete(range=c(3,5))

      



which gives the following output: enter image description here

+4


source







All Articles