Skip to content

ggplotly breaks discrete x-axis with facet_yyyy in panels > 1 with only one category #1720

Closed
@trekonom

Description

@trekonom

ggplotly breaks a discrete axis with facet_yyyy when there is only one category present in a panel, except for the case that this happens to be the first panel. I stumbled over this bug based on a question on Stackoverflow:

library(plotly)

d <- data.frame(cat = c("A", "A", "A"), pan = paste("Panel", c(1, 2, 2)))
ggplot(d, aes(cat)) +
  geom_bar() +
  facet_wrap(~pan)

ggplotly()

facet-breaks-axis

Created on 2020-06-02 by the reprex package (v0.3.0)

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