I want to fill the inside of the dots completely but there are some white spaces inside the dots in a geom_point()
I ran the following code :
library(ggplot2)
set.seed(1)
ggplot(data.frame("Year" = seq(2010, 2019,1),
"Value" = round(rnorm(10), 1),
"Group" = sample(letters[1:3], 10, T)),
aes(Year, Value)) +
geom_point(aes(fill = Group), size = 30, pch = 21)
Which gave me the following plot as output :
As you can see, the color used to fill each plot is not solid and there are white spots inside each dot. What I want is to have dots without those white spots on them.
I also tried with the following code in order to avoid the black line that delimits the dot and see if it fixes the issue but as you can see, the output still has some parts that need to be filled.
set.seed(1)
ggplot(data.frame("Year" = 2013:2022,
"Value" = round(rnorm(10), 1),
"Group" = sample(letters[1:3], 10, T)),
aes(Year, Value)) +
geom_point(aes(color = Group), size = 30)
Is there a way to fix that? I really have a good reason to use points with such sizes.
EDIT:
I added another image (which is a zoom to the original) so you can see the white spaces I'm talking about. They appear even if the border are removed. To remove the border, I used the code suggested by @Caspar V in the comments but it didn't work