For some reason, when using ggplotly() the y-axis values for the second trace are all zero.
library(plotly)
library(dplyr)
df <- diamonds[sample(1:nrow(diamonds), size = 1000),]
df.summ <- df %>%
group_by(cut) %>%
summarize(Mean = mean(table),
Min = min(table),
Max = max(table))
p <- ggplot(df.summ, aes(x = cut, y = Mean, ymin = Min, ymax = Max)) +
geom_bar(stat = "identity") +
geom_errorbar()
print(p)
p <- plotly_build(p)
print(p)
p$data[[2]]$y
This works fine
ggplot(df.summ, aes(x = cut, y = Mean, ymin = Min, ymax = Max)) +
geom_point(size = 10) +
geom_errorbar()
ggplotly()
For some reason, when using
ggplotly()the y-axis values for the second trace are all zero.This works fine