-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix title_spec() for vectorized input #3493
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
fix title_spec() for vectorized input #3493
Conversation
ffb285c
to
655ef2b
Compare
I updated my PR so things don't go haywire with multiple angles. There will still be a warning, though. That's beyond the current issue. library(tidyverse)
library(tibble)
ds <- mtcars %>%
rownames_to_column() %>%
select(car = rowname, mpg)
ds_angle = rep(45, nrow(ds))
ds_angle[10] <- -45
ds %>%
ggplot(aes(x = car, y = mpg)) +
coord_flip() +
theme(axis.text.y = element_text(angle = ds_angle))
#> Warning in if (0 <= angle & angle < 90) {: the condition has length > 1 and
#> only the first element will be used Created on 2019-08-20 by the reprex package (v0.3.0) |
As I mentioned in the issue I really don’t think we should support this use in any way. The correct approach is to make sure it never works IMO |
Is there a reason why you don't go the full mile and deprecate it properly? Is it too harsh in your opinion? |
Yes, it's too harsh I think. A lot of people use vectorized input to We should not disable this option until we have a good alternative in place. Otherwise we just break people's figures without good reason. |
Fair enough. We’ll wait until ggtext is ready for prime time and deprecate then |
+1 |
@hadley Should this get a news item? |
Yeah, I think so - it focus on that this isn't a good idea, rather than the fix. |
How's this?
|
LGTM |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
This seems to fix #3492.
Created on 2019-08-19 by the reprex package (v0.3.0)
Session info