Closed
Description
Bug summary
I want to cycle between multiple markerstyles, including those with a numeric value like CARETRIGHT as documented here, but I get an exception if I add one of those.
Code for reproduction
#!/usr/bin/env python3
from cycler import cycler
import matplotlib.pyplot as plt
import matplotlib.markers as mk
cycle = 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 None
ValueError: 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
Metadata
Metadata
Assignees
Labels
https://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesOpen a pull request against these issues if there are no active ones!Open a pull request against these issues if there are no active ones!