It looks like matplotlib removed ax._get_lines.prop_cycler from their codebase sometime between 3.7 and 3.9.2 and so line 73 in plotting/orbits/backends/matplotlib.py fails with an AttributeError:
File ~/XXXXXX/python3.12/site-packages/hapsira/plotting/orbit/backends/matplotlib.py:73, in Matplotlib2D._get_colors(self, color, trail)
56 """Return the required list of colors if orbit trail is desired.
57
58 Parameters
(...)
69
70 """
71 if color is None:
72 # HACK: https://stackoverflow.com/a/13831816/554319
---> 73 color = next(self.ax._get_lines.prop_cycler)["color"]
75 colors = [color, to_rgba(color, 0)] if trail else [color]
76 return colors
AttributeError: '_process_plot_var_args' object has no attribute 'prop_cycler'
While this was using python 3.12 which isn't supported yet, python 3.11 has the same problem.
I can be reproduce the error using the quickstart example:
from astropy import units as u
from hapsira.bodies import Earth, Mars, Sun
from hapsira.twobody import Orbit
# Data from Curtis, example 4.3
r = [-6045, -3490, 2500] << u.km
v = [-3.457, 6.618, 2.533] << u.km / u.s
orb = Orbit.from_vectors(Earth, r, v)
orb.plot()
🐞 Problem
It looks like matplotlib removed
ax._get_lines.prop_cycler
from their codebase sometime between 3.7 and 3.9.2 and so line 73 inplotting/orbits/backends/matplotlib.py
fails with anAttributeError
:While this was using python 3.12 which isn't supported yet, python 3.11 has the same problem.
I can be reproduce the error using the quickstart example:
🖥 Please paste the output of following commands
conda info -a
(only if you have conda)conda list
(only if you have conda)pip freeze
This is from a new environment created using
💡 Possible solutions Following https://stackoverflow.com/a/78938755, it looks like it only needs to change from
to
I'll have a PR imminently.