Skip to content

Log transform on geom_bar() silently omits layer #2147

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
krlmlr opened this issue May 29, 2017 · 3 comments
Closed

Log transform on geom_bar() silently omits layer #2147

krlmlr opened this issue May 29, 2017 · 3 comments
Labels
coord 🗺️ feature a feature request or enhancement

Comments

@krlmlr
Copy link
Member

krlmlr commented May 29, 2017

After some thinking, geom_bar() cannot work with coord_trans(y = "log10") (#420 (comment)). An error message (or a warning) would be great, though.

library(tidyverse, quietly = TRUE)
diamonds %>% ggplot() + geom_bar(aes(x = cut)) + coord_trans(y = "sqrt")

diamonds %>% ggplot() + geom_bar(aes(x = cut)) + coord_trans(y = "log10")

@has2k1
Copy link
Contributor

has2k1 commented May 29, 2017

I think there is a divide-by-zero in there somewhere that leads to infinite coordinate axes.

@hadley
Copy link
Member

hadley commented Jun 13, 2017

log(0) becomes -Inf, but this should generate a warning or error somewhere.

@karawoo karawoo added feature a feature request or enhancement coord 🗺️ labels Jun 14, 2017
foo-bar-baz-qux added a commit to foo-bar-baz-qux/ggplot2 that referenced this issue Jul 16, 2017
foo-bar-baz-qux added a commit to foo-bar-baz-qux/ggplot2 that referenced this issue Jul 21, 2017
karawoo pushed a commit that referenced this issue Jul 25, 2017
…nite (#2147) (#2210)

* `coord_trans()` now generates a warning when a transformation results in x or y values being non-finite (#2147).

* Add NEWS.md item for new `coord_trans()` warning.
@karawoo
Copy link
Member

karawoo commented Jul 25, 2017

Closed in #2210

@karawoo karawoo closed this as completed Jul 25, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
coord 🗺️ feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants