不言而喻。如果调用了color参数,则x轴上的值排序不正确
df <- structure(list(count = c(8, 3, 5, 9), names = c("I", "want",
"this", "order"), type = c("H", "A", "H", "A")), .Names = c("count",
"names", "type"), row.names = c(NA, -4L), class = "data.frame")
plot_ly(data=df,x=names,y=count,type="bar",
color = type)
Run Code Online (Sandbox Code Playgroud)
这与先前的问题有点类似,但似乎有点骇人之处,无论如何都很难在这里应用
TIA