Scatter3d line_dash length list in px

Hello, I am new to this forum, I have been trying to find an answer to my problem but I have not found it.

I am trying to draw a dashed line in 3D using go.Scatter3d but I would like to customize the line_dash by giving it a px sequence. Works with go.Scatted but not go.Scatted3d

fig = go.Figure()

fig.add_trace(
go.Scatter(
x=[0, 10], y=[0, 10], mode=‘lines’,
line_dash=‘30px,5px’,
showlegend=False))

fig.show()

this is ok, but

fig = go.Figure()

fig.add_trace(
go.Scatter3d(
x=[0, 10], y=[0, 10],z=[1,1],
mode=‘lines’,
line_dash=‘30px,5px’,
showlegend=False))

fig.show()

produce the error

ValueError:
Invalid value of type ‘builtins.str’ received for the ‘dash’ property of scatter3d.line
Received value: ‘30px,5px’

The 'dash' property is an enumeration that may be specified as:
  - One of the following enumeration values:
        ['dash', 'dashdot', 'dot', 'longdash', 'longdashdot',
        'solid']

Is there any way of doing this?

Hi @bullejos welcome to the forums.

Unfortunately the 3D variants are not exactly the same as the 2D counterparts (as you already noticed). Right now, I would not know how to do that for a scatter3d.

Thanks @AIMPED, I’m trying to built some geological models and it would be nice to be able to customize dash lines.

1 Like