Skip to content

xgx_scale_y_percentchangelog10() + geom_jitter() has problems with -100% #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
iamstein opened this issue Mar 31, 2022 · 3 comments
Closed

Comments

@iamstein
Copy link
Member

Hey @margoal1, the -100% (-1) points disappear when using geom_jitter(), but not when using geom_point(). Compare the two plots below. I'm not sure if this is xgx's fault or ggplot2's fault, but just wanted to raise the issue.

data = data.frame(x = c(0, 0, 1, 1, 2, 2), y = c(1, 0, -1, -.5, -1, -1))
ggplot(data, aes(x = x, y = y)) + geom_point() + xgx_scale_y_percentchangelog10()
ggplot(data, aes(x = x, y = y)) + geom_jitter(height = 0, width = 0) + xgx_scale_y_percentchangelog10()

xgx_bug

@iamstein
Copy link
Member Author

One other comment, I don't like the default breaks for xgx_scale_y_percentchangelog10(). Would much prefer it be (-75%, -50%, 0%, 50%, 100%) than what's shown above. In my code, I've fixed it just by setting my own breaks, but I think this could potentially be automated to choose something better.

@iamstein
Copy link
Member Author

iamstein commented Apr 1, 2022

@margoal1: Ooh, the problem is in ggplot2!

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()

image

@iamstein
Copy link
Member Author

iamstein commented Apr 1, 2022

Because this is a ggplot2 issue, I filed an issue on their github page and will close the issue, here.
tidyverse/ggplot2#4790

@iamstein iamstein closed this as completed Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant