-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Milestone
Description
Bug summary
In this code from _axes.py:
matplotlib/lib/matplotlib/axes/_axes.py
Lines 2295 to 2301 in 93a421e
try: | |
facecolor = mcolors.to_rgba_array(facecolor) | |
except ValueError as err: | |
raise ValueError( | |
"'facecolor' or 'color' argument must be a valid color or" | |
"sequence of colors." | |
) from err |
We see that the error message has been split into two lines, however it is missing a whitespace, resulting in the following typo:
argument must be a valid color orsequence of colors.
I would be very happy to tackle this myself as my first matplotlib PR if that's agreeable!
Code for reproduction
import matplotlib.pyplot as plt
# Create a simple plot
fig, ax = plt.subplots()
# This will trigger the facecolor error by passing an invalid color
ax.bar([1, 2, 3], [1, 2, 3], facecolor='invalid_color')
plt.show()
Actual outcome
ValueError: 'facecolor' or 'color' argument must be a valid color orsequence of colors.
Expected outcome
ValueError: 'facecolor' or 'color' argument must be a valid color or sequence of colors.
Additional information
No response
Operating system
No response
Matplotlib Version
3.10.0
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
None
Metadata
Metadata
Assignees
Labels
No labels