I have the following code to generate a 3-D scatter plot:
IU_wide_2_filtered %>%
plot_ly(x = ~CI_scale, y = ~FI_scale, z = ~ConI_scale, type = "scatter3d", mode = "markers") %>%
add_trace(x = ~CI_scale[clus_CI_FI_ConI == 1], y = ~FI_scale[clus_CI_FI_ConI == 1], z = ~ConI_scale[clus_CI_FI_ConI == 1],
type = "scatter3d", mode = "markers",
marker = list(size = 5, symbol = "circle", color = "#303030"),
name = "Cluster 1") %>%
add_trace(x = ~CI_scale[clus_CI_FI_ConI == 2], y = ~FI_scale[clus_CI_FI_ConI == 2], z = ~ConI_scale[clus_CI_FI_ConI == 2],
type = "scatter3d", mode = "markers",
marker = list(size = 5, symbol = "diamond", color = "#808080"),
name = "Cluster 2") %>%
add_trace(x = ~CI_scale[clus_CI_FI_ConI == 3], y = ~FI_scale[clus_CI_FI_ConI == 3], z = ~ConI_scale[clus_CI_FI_ConI == 3],
type = "scatter3d", mode = "markers",
marker = list(size = 5, symbol = "cross", color = "#000000"),
name = "Cluster 3") %>%
layout(scene = list(xaxis = list(title = "CI_scale"),
yaxis = list(title = "FI_scale"),
zaxis = list(title = "ConI_scale"),
showlegend = TRUE))
Which results in:
There's the "trace 0" legend entry, which should not be there. How do I remove it?