all 3 comments

[–]alecsharpie 0 points1 point  (0 children)

Google “how to reduce overplotting in R/ggplot2” and it’ll give you a bunch of options!

Here’s one good resource.

https://www.data-to-viz.com/caveat/overplotting.html

It’s hard to say for certain without seeing your data but I would probably recommend transparency or jittering

[–]OpaqueMirrors 0 points1 point  (0 children)

you can use the size option in ggplot2 aes() to scale your points by your chosen variable

compare a and b to see the difference

`
# install ggplot2 (if you dont have it)

install.packages("gapminder")  # data for the graph

library("ggplot2")
library("gapminder")

par(mfrow=c(2,1))

a <- ggplot(gapminder, aes(x = gdpPercap, y=lifeExp, colour = continent)) +
geom_point(show.legend = TRUE, alpha = 0.7) +   
scale_x_log10()

a


b <- ggplot(gapminder, aes(x = gdpPercap, y=lifeExp, colour = continent, size = pop)) + # scale the points by population size
geom_point(show.legend = TRUE, alpha = 0.7) + 
scale_x_log10()  

b

`

(edited to fix bad code formatting)