MCPcopy Index your code
hub / github.com/plotly/plotly.py / get_dasharray

Function get_dasharray

plotly/matplotlylib/mplexporter/utils.py:56–80  ·  view source on GitHub ↗

Get an SVG dash array for the given matplotlib linestyle Parameters ---------- obj : matplotlib object The matplotlib line or path object, which must have a get_linestyle() method which returns a valid matplotlib line code Returns ------- dasharray : string

(obj)

Source from the content-addressed store, hash-verified

54
55
56def get_dasharray(obj):
57 """Get an SVG dash array for the given matplotlib linestyle
58
59 Parameters
60 ----------
61 obj : matplotlib object
62 The matplotlib line or path object, which must have a get_linestyle()
63 method which returns a valid matplotlib line code
64
65 Returns
66 -------
67 dasharray : string
68 The HTML/SVG dasharray code associated with the object.
69 """
70 if obj.__dict__.get("_dashSeq", None) is not None:
71 return ",".join(map(str, obj._dashSeq))
72 else:
73 ls = obj.get_linestyle()
74 dasharray = LINESTYLES.get(ls, "not found")
75 if dasharray == "not found":
76 warnings.warn(
77 "line style '{0}' not understood: defaulting to solid line.".format(ls)
78 )
79 dasharray = LINESTYLES["solid"]
80 return dasharray
81
82
83PATH_DICT = {

Callers 3

get_path_styleFunction · 0.85
get_line_styleFunction · 0.85
get_grid_styleFunction · 0.85

Calls 2

getMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected