Skip to content

Subplot with faceted ggplots: misplaced facet strips with nrows>1 #1473

Open
@capelastegui

Description

@capelastegui

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)

subplot_facet

subplot_facet_nrows2

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions