Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cb71b64 + fafcabf commit 524a8a0Copy full SHA for 524a8a0
plotly/matplotlylib/mpltools.py
@@ -57,9 +57,21 @@ def convert_dash(mpl_dash):
57
"""Convert mpl line symbol to plotly line symbol and return symbol."""
58
if mpl_dash in DASH_MAP:
59
return DASH_MAP[mpl_dash]
60
- else:
61
- return 'solid' # default
+ else:
+ dash_array = mpl_dash.split(',')
62
+
63
+ if (len(dash_array) < 2):
64
+ return 'solid'
65
66
+ # Catch the exception where the off length is zero, in case
67
+ # matplotlib 'solid' changes from '10,0' to 'N,0'
68
+ if (math.isclose(float(dash_array[1]), 0.)):
69
70
71
+ # If we can't find the dash pattern in the map, convert it
72
+ # into custom values in px, e.g. '7,5' -> '7px,5px'
73
+ dashpx=','.join([x + 'px' for x in dash_array])
74
+ return dashpx
75
76
def convert_path(path):
77
verts = path[0] # may use this later
0 commit comments