dynamicTicks = TRUE with facet_wrap() and categorical axis
Open
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
It seems that dynamicTicks=TRUE in ggplotly is working for categorical data only when the plot is not faceted. Is there a reason for that or is this part of the bug you were working on here: https://github.com/ropensci/plotly/issues/860?
library("ggplot2")
library("plotly")
p1 <- ggplot(mtcars) +
geom_line(aes(x=as.factor(hp), y=mpg, group=1))
p2 <- ggplot(mtcars) +
geom_line(aes(x=as.factor(hp), y=mpg, group=1)) +
facet_wrap(vars(gear))
#non faceted plot works
ggplotly(p1, dynamicTicks = TRUE)
#faceted plot does not work
ggplotly(p2, 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
Run the provided R examples for ggplotly() with dynamicTicks=TRUE, comparing the non-faceted p1 with the facet_wrap() version p2. Trace the dynamicTicks and facet_wrap handling from this entry point; done means categorical axes use dynamic ticks consistently in the faceted plot as they do in the non-faceted plot.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100