Skip to content

Commit

Permalink
Avoid use of private (now-missing) matplotlib attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
ajjackson committed Oct 7, 2024
1 parent bd24a7b commit 14b1091
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions galore/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 14b1091

Please sign in to comment.