plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

marker symbol "y-[up, down, left, right]" doesnt work.

Open Laser-Cho opened this issue 2 years ago • 2 comments

import plotly.graph_objects as go

fig = go.Figure()

symbol = "circle"
new_scatter = go.Scatter(x=[1,2,3], y=[1,2,3], mode="markers", marker=dict(symbol=symbol) )
fig.add_trace(new_scatter) # no-problem

symbol = "y-up"
new_scatter = go.Scatter(x=[4,5,6], y=[4,5,6], mode="markers", marker=dict(symbol=symbol) )
fig.add_trace(new_scatter) # it doesn't show

fig.update_layout(    autosize=False,    width=500,    height=500)
fig.show()

The symbol "y-up" shows nothing. I tried it in two envs, [“plotly.version, jupyterlab.version == (‘5.15.0’, ‘3.0.0’)” , “plotly.version, jupyterlab.version == (‘5.13.1’, ‘4.0.1’)”] , and result is same.

This problem is cross checked by Adam Schroeder. https://community.plotly.com/t/the-marker-symbol-y-up-down-leftm-right-doesnt-show-up/76015/4?u=lasercho

https://plotly.com/python/reference/scatter/?_gl=1u3qwjg_gaNDE5OTk2NjIzLjE2ODEzODc4NDg._ga_6G7EE0JNSC*MTY4NjU4Nzk2Ny4zLjEuMTY4NjU4ODA1Ny4wLjAuMA..#scatter-marker-symbol

Laser-Cho avatar Jun 12 '23 16:06 Laser-Cho

It concerns all symbols that are not filled. They are invisible as long as marker_line_width defaults to zero. If you set

new_scatter = go.Scatter(x=[4,5,6], y=[4,5,6], mode="markers", marker=dict(symbol=symbol, line=dict(width=1)) )

they show up.

johentsch avatar Feb 13 '24 21:02 johentsch

This exactly.

It concerns all symbols that are not filled. They are invisible as long as marker_line_width defaults to zero.

The symbols here are numbered 33-44, 133-144, 233-244 and 333-344. The 0's are regular marks, the 100's are "-open", the 200's are "-dot" and the 300's are "-open-dot".

For reference:

symbol number symbol name
33 cross-thin
34 x-thin
35 asterisk
36 hash
37 y-up
38 y-down
39 y-left
40 y-right
41 line-ew
42 line-ns
43 line-ne
44 line-nw

This behavior is in line with plotly.js. One potential way to fix it is to add the marker.line.width setting to any of these marker numbers. Another would be to change the upstream behavior. Specifically this line: https://github.com/plotly/plotly.js/blob/4390b0dc5ba93e7dc015b079f6c3c02b545524c5/src/traces/scatter/marker_defaults.js#L66. This line sets the width to 0 if the plot isn't a bubble type plot.

TillerBurr avatar Mar 26 '24 22:03 TillerBurr

Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson

gvwilson avatar Jul 11 '24 23:07 gvwilson