Passing a discrete variable (string) as color in scatter plot

How can I pass a discrete variable (string) as color in (3d) scatter plot?

I managed to get that for a continuous variable (float), simply with

marker=dict(...,color = my_cont_var, ...)

…but it doesn’t work for a discrete one.

Thanks for your help :slight_smile:

ok, I found here the solution

(it might be still useful for whoever has the same question)

However, would be great if this will be implemented in a way one does not need to write a for loop

Thanks again

…or better the answer to this similar question