Closed
Description
I'm using ggplot2 3.3.5 and found that geom_point()
and geom_jitter(height = 0, width = 0)
have different behaviors for dealing with zero values in log-transformed axes. In particular, geom_point() represents zeros as dots lying on the x-axis whereas geom_jitter() does not plot the zeros at all. For me, this is relevant, because sometimes I want the jitter width to be non-zero, but height to be zero, and I don't want my dots to disappear! Right now I work around the issue by setting the zeros to some small value I choose to make the plot nice.
data = data.frame(x = c(0, 0, 1, 1, 2, 2), y = c(0, 0, 0, 1, 2, 3))
ggplot(data, aes(x = x, y = y)) + geom_point() + scale_y_log10()
ggplot(data, aes(x = x, y = y)) + geom_jitter(height = 0, width = 0) + scale_y_log10()