Px.scatter with markers at different angles

Hello

I would like to create a px.scatter() figure with multiple ā€˜line-nsā€™ markers at different orientation angles.
Is it possible to pass an array to the ā€œupdate_tracesā€ marker dict?

fig.update_traces(marker=dict(angle="can I put an array here?))

Another way would be to add multiple traces to fig, a trace for every marker.

Thanks a lot for your help!

Hi,

I tried :wink:

The angle argument accepts one number between -180 and 180 only. I think the behavior of the marker styling is not consistent, the symbol argument accepts a list as does the color argument.

import plotly.express as px

fig=px.scatter(x=[1,2,3], y=[1,2,3])
fig.update_traces(marker={'symbol':['square', 'circle', 'diamond'],'color': ['red', 'pink', 'gold'], 'angle':0})
fig.show()

So you would have to try option2.

Hm, I also noticed that for example for ā€œcolorā€ you can pass a list of strings.
For the angular values, I also got the following message when trying to pass a list:

ValueError:
Invalid value of type ā€˜builtins.listā€™ received for the ā€˜angleā€™ property of scatter.marker
Received value: [{10, 100, 45}]

The 'angle' property is a angle (in degrees) that may be
specified as a number between -180 and 180. Numeric values outside this
range are converted to the equivalent value
(e.g. 270 is converted to -90).

Thanks for your help in any case and toodle-pip