Skip to content
Snippets Groups Projects
Verified Commit 7950264f authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

return plotted line from `_plot_single`

parent 57b63ae6
Branches
Tags
No related merge requests found
......@@ -180,7 +180,7 @@ def _parse_graph_style(g: Graph) -> (Dict[str, Any], float):
return style, error_alpha
def _plot_single(g: Graph, i: int, ax: matplotlib.axes.Axes):
def _plot_single(g: Graph, i: int, ax: matplotlib.axes.Axes) -> matplotlib.lines.Line2D:
name = g.get('name', i)
xs, ys, es = _parse_graph_points(g["points"], name)
......@@ -189,7 +189,7 @@ def _plot_single(g: Graph, i: int, ax: matplotlib.axes.Axes):
line_style, error_alpha = _parse_graph_style(g)
ax.plot(xs, ys, label=g.get("name", None), **line_style)
line = ax.plot(xs, ys, label=g.get("name", None), **line_style)[0]
if len(es) != 0:
ys, es = np.array(ys), np.array(es)
......@@ -200,6 +200,8 @@ def _plot_single(g: Graph, i: int, ax: matplotlib.axes.Axes):
else:
ax.fill_between(xs, down, up, alpha=error_alpha, color=line_style["color"])
return line
def _check_class_fields(
obj: Dict[str, Any],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment