Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Labels
Milestone
Description
Bug summary
I want to cycle between multiple markerstyles, including those with a numeric value like CARETRIGHT as documentedhere, but I get an exception if I add one of those.
Code for reproduction
#!/usr/bin/env python3fromcyclerimportcyclerimportmatplotlib.pyplotaspltimportmatplotlib.markersasmkcycle=cycler(marker=["+",mk.CARETRIGHT])t=[0,1]y=[5,6]plt.rc('axes',prop_cycle=cycle)plt.plot(t,y)plt.show()
Actual outcome
Traceback (most recent call last): File "/home/mcd/bugs/bug-cycler.py", line 11, in <module> plt.rc('axes', prop_cycle=cycle) File "/usr/lib/python3.11/site-packages/matplotlib/pyplot.py", line 670, in rc matplotlib.rc(group, **kwargs) File "/usr/lib/python3.11/site-packages/matplotlib/__init__.py", line 1062, in rc rcParams[key] = v ~~~~~~~~^^^^^ File "/usr/lib/python3.11/site-packages/matplotlib/__init__.py", line 734, in __setitem__ raise ValueError(f"Key {key}: {ve}") from NoneValueError: Key axes.prop_cycle: Could not convert 5 to str
Expected outcome
A plot using CARETLEFT as marker.
Additional information
This seems like it has to do with the fact, that some markers are referred to by number and not by a string like "+".
I don't know whether the problem is in matplotlib, cycler or the combination of both.
Operating system
Artix Linux
Matplotlib Version
3.8.1
Matplotlib Backend
GTK4Agg
Python version
Python 3.11.6
Jupyter version
No response
Installation
Linux package manager