I’m trying to make a scatter plot where I can distinguish two features.
I want to have different colours for all the types of items I have, and then to use a different symbol for the origin of the items. When I do this, my legend shows the correct colors for each item type, then lists the origins showing the correct different shapes, but in three new colors, and then everything is plotted as the symbols in the origin color shown in the legend.
So now I can only distinguish my items by origin.
Is it possible to set the color and symbol independently?
pSets <- plot_ly(df, x = X, y = Y,color = itemType,colors =itemCol,type = “scatter”,mode=“markers”,symbol=origin,symbols=c(“dot”,“cross”,“diamond”))