diff --git a/src/hapsira/plotting/orbit/backends/matplotlib.py b/src/hapsira/plotting/orbit/backends/matplotlib.py index 1f489bab9..629d1effc 100644 --- a/src/hapsira/plotting/orbit/backends/matplotlib.py +++ b/src/hapsira/plotting/orbit/backends/matplotlib.py @@ -69,8 +69,12 @@ def _get_colors(self, color, trail): """ if color is None: - # HACK: https://stackoverflow.com/a/13831816/554319 - color = next(self.ax._get_lines.prop_cycler)["color"] + try: + # Updated HACK, see https://stackoverflow.com/a/78938755 + color = self.ax._get_lines.get_next_color() + except AttributeError: + # HACK: https://stackoverflow.com/a/13831816/554319 + color = next(self.ax._get_lines.prop_cycler)["color"] colors = [color, to_rgba(color, 0)] if trail else [color] return colors