ggplotly breaks custom, log transformed, axis labels
Open
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
Unfortunately this does not show an error, only a warning. A better behavior would probably be returning an error when passing an expression.
See below for an example where the x axis has been log transformed.
plot_gg = ggplot(iris,aes(Sepal.Length,Sepal.Width,col=Species))+
geom_point()+
scale_x_continuous(trans = scales::log2_trans(),
breaks = scales::trans_breaks("log2", function(x) 2^x),
labels = scales::trans_format("log2", scales::math_format(2^.x)))
plot_gg

plot_ly=plotly::ggplotly(plot_gg)
plot_ly

Warning message:
In is.na(ticktext) :
is.na() applied to non-(list or vector) of type 'expression'
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 R example in the issue and compare the ggplot2 output with the ggplotly output and warning. Trace how ggplotly handles transformed axis breaks and expression-valued labels; done means the behavior is intentional and covered by a regression check, either by handling the labels correctly or reporting the unsupported expression clearly.
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