diff --git a/ultraplot/axes/plot.py b/ultraplot/axes/plot.py index 7a5785822..e1e83d3cd 100644 --- a/ultraplot/axes/plot.py +++ b/ultraplot/axes/plot.py @@ -2491,10 +2491,6 @@ def _parse_cycle( # Ignore cycle for single-column plotting resolved_cycle = None if ncycle == 1 else resolved_cycle - # Return or apply cycle - if return_cycle: - return resolved_cycle, kwargs - if resolved_cycle and resolved_cycle != self._active_cycle: self.set_prop_cycle(resolved_cycle) @@ -2505,8 +2501,10 @@ def _parse_cycle( for prop, key in cycle_manually.items(): if kwargs.get(key) is None and prop in current_prop: value = current_prop[prop] - kwargs[key] = pcolors.to_rgba(value) if key == "c" else value - + kwargs[key] = pcolors.to_hex(value) if key == "c" else value + # Return or apply cycle + if return_cycle: + return resolved_cycle, kwargs return kwargs def _parse_level_lim( diff --git a/ultraplot/constructor.py b/ultraplot/constructor.py index f3df94e09..d5aae8bd3 100644 --- a/ultraplot/constructor.py +++ b/ultraplot/constructor.py @@ -852,7 +852,6 @@ class Cycle(cycler.Cycler): """ def __init__(self, *args, N=None, samples=None, name=None, **kwargs): - self.name = "_no_name" # default value cycler_props = self._parse_basic_properties(kwargs) samples = _not_none(samples=samples, N=N) # trigger Colormap default if not args: @@ -863,6 +862,7 @@ def __init__(self, *args, N=None, samples=None, name=None, **kwargs): self._handle_colormap_args(args, cycler_props, kwargs, samples, name) self._iterator = None # internal reference for cycle + self.name = _not_none(name, "_no_name") def _parse_basic_properties(self, kwargs): """Parse and validate basic properties from kwargs."""