Subplot with faceted ggplots: misplaced facet strips with nrows>1
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
When passing faceted ggplots to subplot(), the result is rendered properly as long as nrows=1. However, once I pass nrows=2 or greater, the facet strips become misplaced.
require(ggplot)
require(plotly)
ggiris <- qplot(Petal.Width, Sepal.Length, data = iris, color = Species)
# With nrows = 1, facets are rendered properly
subplot (ggiris , ggiris+facet_wrap(~Species))
# With nrows>1, facets are messed up
subplot (ggiris , ggiris+facet_wrap(~Species), nrows=2)


This used to work correctly on my system, using a previous version of the library - I found the error after updating plotly and a bunch of other libraries. Unfortunately, I haven't been able to restore the previous environment, so I don't know on which release it stopped working.
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 reproducing the examples in the issue with subplot(), facet_wrap(), and nrows=2, then trace the subplot entry point and its handling of faceted ggplots and row layout. Done means facet strips remain correctly positioned when nrows is greater than 1, with a regression test covering the reported example.
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