Empty objects in subplot
Open
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
An error arises when mix an empty object with ggplot-derived plotly in subplot
library(plotly); library(ggplot2)
df <- data.frame(dose=c("D0.5", "D1", "D2"), len=c(4.2, 10, 29.5))
p<-ggplot(data=df, aes(x=dose, y=len)) +geom_bar(stat="identity")
ply <- ggplotly(p)
# This gives an error.
subplot(ply, ply, ggplotly(ggplot()), nrows=1, shareX=F, shareY=F, margin=0, widths=c(0.3, 0.3, 0.3))
# This gives a warning.
subplot(ply, ply, plotly_empty(type = "scatter"), nrows=1, shareX=F, shareY=F, margin=0, widths=c(0.3, 0.3, 0.3))
What are the possible solutions? Thanks!
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 reproducible R example with ggplotly(), subplot(), and plotly_empty() to observe the error and warning. Inspect the subplot handling for empty plot objects and define regression coverage for both cases; done means empty objects can be combined without an error or warning.
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
- Needs clarification
- Newbie friendliness
- 35/100