Skip to content

ggplotly: Incorrect display of x-axis with geom_bar in the case of one axis label #514

Closed
@Safstat

Description

@Safstat

Hello,
I installed the new version of plotly (3.4.1) and I have found this problem:
The display of x-axis is incorrect with geom_bar when we have only one axis label
-- whereas it works fine when I just run the ggplot().
Here's my code:

df <- data.frame(Class = c("A","B","S","H","G","F","P","W","Y","X"),
                   Y_value = c(3,0,0,20,50,0,0,4,0,0),
                   Var2 = c("56","56","56","56","56","56","56","56","56","56"))
plot<-ggplot(df,aes(factor(Var2, levels=unique(as.character(Var2))),fill=Class, Y_value)) +
  geom_bar(stat="identity", colour="black", size=0.35,show.legend = TRUE)+
  theme_grey()+
  xlab("")+ ylab("")
ggplotly(plot)

image

whereas when I just run the ggplot() I obtain x-axis well displayed

plot

image

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