Skip to content

geom_errorbar is not rendered unless the y aes is set #1751

Closed
@eliocamp

Description

@eliocamp

In ggplot2, the only aesthetics needed for geom_errorbar are ymin and ymax. However, ggplotly fails unless I also specify the y aesthetic.

library(ggplot2)
library(plotly)

data <- data.frame(auc=c(0.268707482993197,0.571428571428571), 
                   sup=c(0.407680628614317,0.648343533190079), 
                   inf=c(0.129734337372078,0.494513609667063), 
                   Names = c("Firmicutes","Spirochaetes"))


ggplot(data, aes(Names)) +
  geom_errorbar(aes(ymin = inf, ymax = sup))    

plotly::ggplotly()

image

ggplot(data, aes(Names)) +
  geom_errorbar(aes(y = auc, ymin = inf, ymax = sup))    

plotly::ggplotly()

image

Created on 2020-04-23 by the reprex package (v0.3.0)

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