Skip to content

x axis problem when using facets with a unique value on the x axis #1577

Closed
@paobranco

Description

@paobranco

Hi,
Great package!

I found an issue when using facet_wrap and facet_grid.
The problem is related with the existence of a unique value in the x axis. When this happens, only the first panel shows the x axis correctly.
Here is a reproducible example:

data(iris)
ds <- iris[1:10,]
ds$var <- as.factor(c(rep("A", 5), rep("B",5)))
p <- ggplot(ds, aes(x=Species, y=Petal.Length))+facet_grid(~var)+geom_point()
p

This produces this plot:
Rplot1

However, when using ggplotly

ggplotly(p)

This happens:
Rplot2

The x axis of the first panel is OK, but all the other panels will show numbers on the x axis.

Thank you!

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