You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When error_x is used along with a factor variable assigned to the color attribute in plot_ly, the resulting plot displays the error bars around the wrong points. Below is a working example using source code from the plotly for R book. You can see in the plot that the standard errors are being mapped to the wrong coefficients.
m <- lm(Sepal.Length ~ Sepal.Width * Petal.Length * Petal.Width, data = iris)
d <- broom::tidy(m) %>%
arrange(desc(estimate)) %>%
mutate(term = factor(term, levels = term),
one_col=cut(estimate,3,labels=c("Low","Medium","High")))
plot_ly(d, x = ~estimate, y = ~term,color=~one_col) %>%
add_markers(error_x = ~list(array=std.error,type="array")) %>%
layout(margin = list(l = 200))