diff --git a/ultraplot/axes/plot.py b/ultraplot/axes/plot.py index e1e83d3cd..4a11dd6e1 100644 --- a/ultraplot/axes/plot.py +++ b/ultraplot/axes/plot.py @@ -2485,6 +2485,8 @@ def _parse_cycle( resolved_cycle = None case str() | int(): resolved_cycle = constructor.Cycle(cycle, **cycle_kw) + case constructor.Cycle(): + resolved_cycle = constructor.Cycle(cycle) case _: resolved_cycle = None diff --git a/ultraplot/tests/test_constructor.py b/ultraplot/tests/test_constructor.py index 942e5a05e..912437614 100644 --- a/ultraplot/tests/test_constructor.py +++ b/ultraplot/tests/test_constructor.py @@ -97,3 +97,14 @@ def test_manual_cycle(): props = ax._active_cycle.get_next() assert cycled_pos == parser._idx assert props == parser._cycler_items[parser._idx] + + +def test_pass_on_cycle(): + colors = ["red", "green", "black"] + cycle = uplt.Cycle(colors) + fig, ax = uplt.subplots() + ax.set_prop_cycle(cycle) + active_cycle = ax.axes._active_cycle + for color in colors: + assert color == active_cycle.get_next()["color"] + assert color == cycle.get_next()["color"]