是否可以在R中订购图例条目?
如果我例如指定一个这样的饼图:
plot_ly(df, labels = Product, values = Patients, type = "pie",
marker = list(colors = Color), textfont=list(color = "white")) %>%
layout(legend = list(x = 1, y = 0.5))
Run Code Online (Sandbox Code Playgroud)
图例按哪个产品患者数最多排序.我希望图例按产品的字母顺序排序.
这可能吗?