plotly / plotly/plotly.py

lightposition in Surface plots does not function correctly

Open
#2,176 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When setting the position of the light source in a 3d surface plot using

go.Surface(z=myz,x=myx,y=myy,lightposition=dict(x=1e5, y=0, z=0.),

the x,y,z components of the light source position do not appear to make any sense. They do not work as sensible vector, and will flip the light position with minor changes of x,y or z. Currently it seems you have to spend ages trying different random combinations of values until something vaguely works. This is very unsatisfactory. The documentation is not at all helpful as it implies the light position is a sensible vector, which it doesn't appear to be:

lightposition
Parent: data[type=surface]
Type: dict containing one or more of the keys listed below.
x
Parent: data[type=surface].lightposition
Type: number between or equal to -100000 and 100000
Default: 10
Numeric vector, representing the X coordinate for each vertex.
y
Parent: data[type=surface].lightposition
Type: number between or equal to -100000 and 100000
Default: 10000
Numeric vector, representing the Y coordinate for each vertex.
z
Parent: data[type=surface].lightposition
Type: number between or equal to -100000 and 100000
Default: 0
Numeric vector, representing the Z coordinate for each vertex.

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 by reproducing the issue with go.Surface and the lightposition x, y, and z values shown in the report. Trace how those coordinates are interpreted for 3D surface plots, then verify the behavior against the documented coordinate ranges and make the light position respond predictably to those values.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.