Last active
May 13, 2019 09:57
-
-
Save djnavarro/e1dabb01aa3a5a3dea534c09c2f4e84d to your computer and use it in GitHub Desktop.
example where coord_trans throws many warnings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from section 7.5.1 of ggplot2 book | |
library(ggplot2) | |
base <- ggplot(diamonds, aes(carat, price)) + | |
stat_bin2d() + | |
geom_smooth(method = "lm") + | |
xlab(NULL) + | |
ylab(NULL) + | |
theme(legend.position = "none") | |
pow10 <- scales::exp_trans(10) | |
base + | |
scale_x_log10() + | |
scale_y_log10() + | |
coord_trans(x = pow10, y = pow10) # <-- many warnings thrown here | |
# Warning messages: | |
# 1: In self$trans$x$inverse(panel_params$x.range) : NaNs produced | |
# 2: In self$trans$y$inverse(panel_params$y.range) : NaNs produced | |
# 3: In self$trans$x$inverse(panel_params$x.range) : NaNs produced | |
# 4: In self$trans$y$inverse(panel_params$y.range) : NaNs produced | |
# etc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment