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

coord_trans with continuous_scale and minor_breaks = NULL causes error #1422

Closed
dbeltoft opened this Issue Dec 3, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@dbeltoft

dbeltoft commented Dec 3, 2015

Hi

Noob here, apologize in advance if this is already known, or if I misunderstood a feature as a bug.

When trying to suppress minor breaks on my axis, while applying a coordinate transformation with coord_trans, I get an error. Here is a minimal example to reproduce the error:

library(ggplot2)
data <- data.frame(x = c(1,2,3), y = c(5,2,4))
ggplot(data, aes(x,y)) + 
  geom_point() +
  scale_x_continuous(minor_breaks = NULL) +
  coord_trans(xtrans = "log")                                  # This line causes the error
# Error in log(x, base) : non-numeric argument to mathematical function

Going through the traceback, it seems that transform_value does not check for NULL arguments, which makes it fail when trying to rescale the minor breaks.

@hadley hadley closed this in b4ca516 Dec 12, 2015

@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018

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