Plotly.py: Specifying dash length list no longer works

Created on 13 Aug 2018  路  3Comments  路  Source: plotly/plotly.py

In plotly.py 3.x, I can no longer specify a dashed line by specifying a string of dash lengths. Before updating to version 3, I could do this.

From the docs for scatter -> line -> dash:

Sets the dash style of lines. Set to a dash type string ("solid", "dot", "dash", "longdash", "dashdot", or "longdashdot") or a dash length list in px (eg "5px,10px,2px,2px").

The latter option no longer appears to be valid, yielding a ValueError. For example, the following does not work (tested in a Jupyter notebook):

import plotly.graph_objs as go

data = [
    {
        'y': [1,2,3],
        'line': {
            'dash': '5px,10px,2px,2px',
        }
    }
]
go.FigureWidget(data)
bug

All 3 comments

Hi @APlowman , thanks for the report!

I just opened an associated issue on the Plotly.js project to work out how we should handle this case. Check it out if you're interested in what went wronge here: https://github.com/plotly/plotly.js/issues/2903

Ok, looks like we'll handle this by introducing a custom LineDash validator class.

Fixed in #1136

Was this page helpful?
0 / 5 - 0 ratings