You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
iamstein
changed the title
geom_point() and geom_jitter(width = 0, height = 0) have different behaviors 0 values in scale_y_log10()
geom_point() and geom_jitter(width = 0, height = 0) have different behaviors for zero values in scale_y_log10()
Apr 1, 2022
Thanks. it seems jitter calculates -Inf for -Inf value, accordingly, -Inf - (-Inf) results in NaN. We can check if the value is infinite and skip jittering.
Uh oh!
There was an error while loading. Please reload this page.
I'm using ggplot2 3.3.5 and found that
geom_point()
andgeom_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.The text was updated successfully, but these errors were encountered: