Skip to content

[Bug]: Missing whitespace in _axes.py error message #30285

@brchristian

Description

@brchristian

Bug summary

In this code from _axes.py:

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions