plotly / plotly/graphing-library-docs

example code doesn't work

Open
#156 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
59
Forks
72
Avg merge
1d 19h
Merged PRs (30d)
3

Description

Hi,

The example code in matplotlib_to_plotly() (https://plotly.com/python/v3/matplotlib-colorscales/) doesn't work due to a TypeError.

Anyway, I am sure that the argument meant to be passed to this function is the [colorscale]_rgb list ... which again throws a TypeError, but this can be fixed by editing one line:

C = list(map(np.uint8, np.array(cmap_rgb[k])*255))

Then it works.

Contributor guide

No contributing guide indexed for this repository

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

Open the matplotlib_to_plotly() example at the linked Plotly documentation page and reproduce the reported TypeError. Compare the cmap_rgb conversion with the one-line change described in the issue; done means the documented example runs without the TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
data-visualization, documentation
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.