scenarios in `ggplot2` when using `geom_point` with `position_jitter` and `size` aesthetic causes points to disappear
I'm integrating two systems and I'm converting an old project and I'm currently working with an scenario when trying to create a scatter plot using `ggplot2` in R. I'm using `geom_point()` with `position_jitter` to add some random noise to the point positions for better visibility. However, when I attempt to set the `size` aesthetic based on a variable, some points seem to disappear entirely from the plot. Here is a simplified version of my code: ```R library(ggplot2) # Sample data set.seed(123) data <- data.frame( x = rnorm(100), y = rnorm(100), group = as.factor(sample(1:3, 100, replace = TRUE)), size_var = runif(100, 1, 5) ) # Plotting ggplot(data, aes(x = x, y = y, color = group, size = size_var)) + geom_point(position = position_jitter(width = 0.2, height = 0.2)) + theme_minimal() ``` When I run this, I see that some of the points are missing from the plot. I tried adjusting the `size` range both in the dataset and in the `scale_size_continuous()` function, but it didn't change anything. Additionally, I've ensured that the `size_var` values are all positive. Hereβs the code I used to set the size scale: ```R scale_size_continuous(range = c(1, 5)) ``` Despite these efforts, I still encounter the same scenario where certain points do not appear on the plot. I've double-checked the data to make sure there are no NaN values in the `size_var`, and I've verified that all points have valid coordinates. Does anyone have insights into why some points are disappearing when I use the `size` aesthetic in conjunction with `position_jitter`? Is there perhaps a known bug or limitation in the version of `ggplot2` Iβm using (currently 3.3.5)? Any suggestions on how I can diagnose this scenario further would be greatly appreciated! I recently upgraded to R stable. Hoping someone can shed some light on this.