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

Already on GitHub? Sign in to your account

Log transform on geom_bar() silently omits layer #2147

Closed
krlmlr opened this Issue May 29, 2017 · 3 comments

Comments

Projects
None yet
4 participants
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")

Contributor

has2k1 commented May 29, 2017

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

Owner

hadley commented Jun 13, 2017

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

@foo-bar-baz-qux foo-bar-baz-qux added a commit to foo-bar-baz-qux/ggplot2 that referenced this issue Jul 16, 2017

@foo-bar-baz-qux foo-bar-baz-qux `coord_trans()` now generates a warning when a transformation results…
… in x or y values being non-finite (#2147).
1ece1d7

@foo-bar-baz-qux foo-bar-baz-qux added a commit to foo-bar-baz-qux/ggplot2 that referenced this issue Jul 21, 2017

@foo-bar-baz-qux foo-bar-baz-qux `coord_trans()` now generates a warning when a transformation results…
… in x or y values being non-finite (#2147).
1564029

@karawoo karawoo added a commit that referenced this issue Jul 25, 2017

@foo-bar-baz-qux @karawoo foo-bar-baz-qux + karawoo Add warning for coord_trans() when resulting x/y value becomes non-fi…
…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.
1477187
Collaborator

karawoo commented Jul 25, 2017

Closed in #2210

karawoo closed this Jul 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment