subplot - merging titles following ggplotly conversion
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
data(faithful)
p1 <- plotly::ggplotly(
ggplot(faithful, aes(x = eruptions)) +
geom_histogram(bins = 20) +
theme_minimal() +
labs(title = "A.")
)
p2 <- plotly::ggplotly(
ggplot(faithful, aes(x = waiting)) +
geom_histogram(bins = 20) +
theme_minimal() +
labs(title = "B.")
)
pl <- subplot(p1, p2, nrows = 1, titleX = TRUE)
## note that changing to labs(tag = "A.") results in loss of the 'tag' at the ggplotly function.
I am creating a gglot (histogram, in this case) which includes a sub-panel label. I want to then convert to a plotly figure using the plotly::ggplotly function. The label is transmitted faithfully to each of p1 and p2. However, when combining these into a subplot, the label seems to be merged . I lose the 'A.' label on the first plot p1, generally. The titleX option does not prevent this from occurring.
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 with the reproducible faithful-data example using ggplotly and subplot, then trace how subplot combines the titles from p1 and p2 when titleX is enabled. Confirm the behavior for labs(title = "A.") and labs(title = "B."); done means both labels remain visible after conversion and combination.
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