Is there a way to add lights and or shades around a dot to get a close result to the following image using geom_point
?
I have thought about creating a gradient for each dot but I don't know how to implement it since each dot should have a single value.
Found the following topic where the author kind of achieved to get 3 colors per dot but I don't know the strucure of his data and it seems that he plotted each dot 3 times.
R ggplot increase points by size and by color for same variable
Reproducible example
##### Initiating data
dfDot <- data.frame(value=1,
group="A")
##### Display plot
plotDot <-
ggplot(data=dfDot, aes(x=group, y=value)) +
geom_point(size=80) +
theme_dark() +
theme(axis.title=element_blank(),
axis.text=element_blank(),
axis.ticks=element_blank())
Following MrFlick answer
Using both geom_point and with_blur from MrFlick proposition, could achieve something close to the image
##### Import blur library
library(ggfx)
##### Initiating data
dfDot <- data.frame(value=sort(rnorm(120)),
group=rep(c("A", "B", "C"), each=40))
##### Defining colors
myColors <- c("#7be5d7", "#e57b7b", "#e5d57b")
##### Display plot
ggplot(data=dfDot, aes(x=group, y=value, color=group)) +
with_blur(
geom_point(size=8), sigma=20
) +
geom_point(size=3, alpha=0.05) +
scale_colour_manual(values=myColors, guide="none") +
theme_dark() +
theme(axis.title=element_blank(),
axis.text=element_blank(),
axis.ticks=element_blank())
Do you just want to add some blur to the point? You can do that with the ggfx
library. For example
library(ggfx)
dfDot <- data.frame(value=1,
group="A")
##### Display plot
ggplot(data=dfDot, aes(x=group, y=value)) +
with_blur(
geom_point(size=80), sigma=20
) +
theme_dark() +
theme(axis.title=element_blank(),
axis.text=element_blank(),
axis.ticks=element_blank())