ggpubr
ggpubr copied to clipboard
How to make the points jitter in ggpubr scatter plot using "ggscatter" function?
I don't find any parameters in "ggscatter" to make the points jitter. I added the "position_jitter" function in ggplot2 after the "ggscatter" function, but it seems not work. Could any friends recommend other methods?
I second this question and request. Jitter is available for ggboxplot
but not ggscatter
when arguably it is more valuable to jitter high-n scatterplots in combination with alpha to visualize areas of high data saturation. Perhaps a way to feed in a position argument along with position_jitter
?
Try adding geom_jitter():
ggscatter(df, x = "x", y = "y") +
geom_jitter()
Adding geom_jitter() will result in points being plotted twice. You can add point = "FALSE"
to the ggscatter call before adding geom_jitter, that is working (in my hands at least).
(Although it reverts to ggplot2-style points)
ggscatter(df, y="var", point = "FALSE") + geom_jitter()