Skip to content

y-axis range not set properly when facet_wrap(scales = "free_y") #166

@cpsievert

Description

@cpsievert

This is related to the scales="free" bullet of #161, but is probably worth noting separately. I'll send a pull request in attempt to fix both. I've uploaded this plot to demonstrate a bug in the y-axis limits:

library("plotly")
no_panels <- ggplot(mtcars, aes(mpg, wt)) + geom_point()
no_panels + facet_wrap(~am+vs, scales = "free")

On a larger note, the package currently seems a little confused about the conceptual difference between facet_grid and facet_wrap in terms of free scales. For facet_grid, the y-axis/x-axis has to be fixed for a given row/column. But for facet_wrap, each panel is allowed to have it's own axis. I think this figure from the ggplot2 book helps demonstrate that:

position-facets

@chriddyp @mkcor do you know if the plotly API would support drawing an axis on each panel?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions