plotly / plotly/plotly.py

allow varying marker.line.width in 3DScatter plot

Open
#2,438 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature P3
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

Varying marker.line.width works nicely in go.Scatter, you're able to specify a different outline width for each point:

works

import plotly.graph_objs as go

x = [1,2,3]
y = [1,2,3]

fig = go.Figure(
          data=[go.Scatter(x=x, y=y,
            mode='markers',
            marker=dict(size=30,
              color=['rgba(100,0,0,.5)','rgba(0,100,0,.5)','rgba(0,0,100,.5)'],
              line=dict(color=['rgb(0,100,0)','rgb(0,0,100)','rgb(100,0,0)'], width=[3,6,9])
            ),
          )])

fig.show()

However in go.Scatter3d this functionally does not work:

import plotly.graph_objs as go

x = [1,2,3]
y = [1,2,3]
z = [1,2,3]

fig = go.Figure(
          data=[go.Scatter3d(x=x, y=y,z=z,
            mode='markers',
            marker=dict(size=30,
              color=['rgba(100,0,0,.5)','rgba(0,100,0,.5)','rgba(0,0,100,.5)'],
              line=dict(color=['rgb(0,100,0)','rgb(0,0,100)','rgb(100,0,0)'], width=[3,6,9])
            ),
          )])

fig.show()

ValueError: Invalid value of type 'builtins.list' received for the 'width' property of scatter3d.marker.line Received value: [3, 6, 9] The 'width' property is a number and may be specified as: - An int or float in the interval [0, inf]

This different functionality is actually reflected in the documentation, but additionally, passing a single value to data[type=scatter3d].marker.line.width does not actually change point outline widths; changing [3,6,9] in the above code to 20 or .5 results in the same graph.

It would be great if go.Scatter3d could behave the same as go.Scatter for this.

I'm using plotly 4.6.0 py_0 plotly
installed 05/05/20 using conda install -c plotly plotly

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Scatter3d marker.line.width implementation and compare it with the working Scatter behavior. Run the provided Python examples to reproduce both the list-value validation error and the ineffective scalar value; done means per-point widths are accepted and scalar widths visibly change point outlines.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.