Skip to content

Commit

Permalink
Fix for shared cycler hack
Browse files Browse the repository at this point in the history
  • Loading branch information
eltos committed Oct 11, 2023
1 parent df23516 commit 77222b2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion xplt/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,15 @@ def __init__(
if nntwins is not None:
for j in range(nntwins[i]):
twin = a.twinx()
twin._get_lines.prop_cycler = a._get_lines.prop_cycler
try:
# hack for shared cyclers
# see https://github.com/matplotlib/matplotlib/issues/19479
twin._get_lines = a._get_lines
except:
print(
"Warning: failed to share cyclers, please manually set trace colors for twin axes and make sure to upvote https://github.com/matplotlib/matplotlib/issues/19479"
)
pass # ignore
if j > 0:
twin.spines.right.set_position(("axes", 1 + 0.2 * j))
self.axflat_twin[i].append(twin)
Expand Down

0 comments on commit 77222b2

Please sign in to comment.