ggplotly has a bug where negative values are incorrectly displayed as positive in the tooltip (a known and unresolved issue).
library(ggplot2)
library(plotly)
mydf <- data.frame("drug"=c("A", "B", "C"),
"response"=c(1,5,-5))
p <- ggplot(mydf, aes(x=drug, y=response))+
geom_bar(stat="identity")
ggplotly(p)
Since the issue is a few years old I'm wondering if anyone has found a fix? Strangely, negative values are correctly displayed in the tooltip for geom_point
, but not geom_bar
...