dynamicticks = T & faceting
Open
Nobody has claimed this yet.
bug
ggplotly
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
Trying facet_wrap with a categorical y axis and dynamicTicks =TRUE ends in:
Error in tickvals - val : non-numeric argument to binary operator
ggplot is OK, only ggplotly returns the problem
Ideas?
db <- data_frame(
x = c("a1", "b", "c1", "a2", "b", "c2"),
Var = c("a", "a", "a", "b", "b", "b"),
n = c(70, 50, 30, 30, 50, 70)
)
p <- db %>%
ggplot(aes(x = reorder(x,n), y = n)) +
geom_col() +
coord_flip() +
facet_wrap(~Var, scales = "free")
p
ggplotly(p, dynamicTicks = TRUE)
Now, if you wonder why I want to use dynamicTicks in the first place, see this example:
db <- data_frame(
s = paste0(sample(LETTERS, 2000, replace = T), sample(LETTERS, 2000, replace = T)),
x = sample(s[1:100], 2000, replace = T)
)
db %>% count(x, sort = T) %>%
ggplot(aes(x = reorder(x,n), y = n)) +
geom_col() +
coord_flip()
ggplotly(dynamicTicks = TRUE)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the reported R example with ggplotly(), dynamicTicks = TRUE, facet_wrap(), a categorical axis, and coord_flip(). Trace the tick handling that produces the non-numeric argument error. Done means the faceted plot renders without the error and dynamic ticks work for the categorical axis.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100