From b0812a3fb49ee2c7e09c209f859cd82f3c544d21 Mon Sep 17 00:00:00 2001 From: "Adam J. Jackson" Date: Mon, 7 Oct 2024 12:17:02 +0100 Subject: [PATCH] Avoid use of private (now-missing) matplotlib attribute --- galore/plot.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/galore/plot.py b/galore/plot.py index cba2b28..7b5eacb 100644 --- a/galore/plot.py +++ b/galore/plot.py @@ -158,15 +158,14 @@ def plot_pdos(pdos_data, ax=None, total=True, show_orbitals=True, offset=0., fli max_y = max(max_y, max(el_data[orbital])) if show_orbitals: - color = next(ax._get_lines.prop_cycler)['color'] # get color to ensure - # matching fill label = (None if max(el_data[orbital]) < legend_cutoff * tmax else "{0}: {1}".format(element, orbital)) - ax.plot(x_data, el_data[orbital], color=color, label=label, - marker='', linestyle=next(linecycler)) + (line2d, ) = ax.plot(x_data, el_data[orbital], label=label, + marker='', linestyle=next(linecycler)) if fill: - ax.fill_between(x_data, el_data[orbital], color=color, alpha=alpha) + ax.fill_between(x_data, el_data[orbital], + color=line2d.get_color(), alpha=alpha) if total: max_y = max(tdos)