Skip to content

facet_grid with an expression cannot have margins #1864

Closed
@has2k1

Description

@has2k1

A visual of the issue,

ggplot(mtcars, aes(wt, mpg)) + geom_point() + facet_grid(vs~I(am+1), margins=T)

grid-expression-margin

The column (expression variable) margin is missing data!

The problem arises because these two lines depend on each other. The margins must be added with all the facet variables present in the data, yet the facet values must be computed with margins already computed and present in the data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions