graphing-library-docs icon indicating copy to clipboard operation
graphing-library-docs copied to clipboard

example code doesn't work

Open elastufka opened this issue 4 years ago • 0 comments

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.

elastufka avatar Oct 05 '21 14:10 elastufka