Varying opacity in scatter_3d

Hi, I think I still don’t understand what you are after. You get two categories because you have two categories, namely A and B.

Maybe you could your data (or equivalent data) ? In general, the legend in plotly is somehow limited IMHO. A possible solution could be the use of graph_objects and legendgroups

Take a look at this, maybe it helps: