You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Setting the edgecolor when using ax.hist raises Invalid RGBA argument in >=3.10 #29985
Traceback (most recent call last):
File "/home/nvaytet/code/mpltoolbox/jupyter/example.py", line 7, in <module>
ax.hist(
File "/home/nvaytet/miniforge3/lib/python3.12/site-packages/matplotlib/_api/deprecation.py", line 453, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/nvaytet/miniforge3/lib/python3.12/site-packages/matplotlib/__init__.py", line 1521, in inner
return func(
^^^^^
File "/home/nvaytet/miniforge3/lib/python3.12/site-packages/matplotlib/axes/_axes.py", line 7266, in hist
p._internal_update(kwargs)
File "/home/nvaytet/miniforge3/lib/python3.12/site-packages/matplotlib/artist.py", line 1233, in _internal_update
return self._update_props(
^^^^^^^^^^^^^^^^^^^
File "/home/nvaytet/miniforge3/lib/python3.12/site-packages/matplotlib/artist.py", line 1209, in _update_props
ret.append(func(v))
^^^^^^^
File "/home/nvaytet/miniforge3/lib/python3.12/site-packages/matplotlib/patches.py", line 386, in set_edgecolor
self._set_edgecolor(color)
File "/home/nvaytet/miniforge3/lib/python3.12/site-packages/matplotlib/patches.py", line 372, in _set_edgecolor
self._edgecolor = colors.to_rgba(color, self._alpha)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nvaytet/miniforge3/lib/python3.12/site-packages/matplotlib/colors.py", line 316, in to_rgba
rgba = _to_rgba_no_colorcycle(c, alpha)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nvaytet/miniforge3/lib/python3.12/site-packages/matplotlib/colors.py", line 400, in _to_rgba_no_colorcycle
raise ValueError(f"Invalid RGBA argument: {orig_c!r}")
ValueError: Invalid RGBA argument: np.float64(0.5)
Expected outcome
Should not raise.
Additional information
This raises with matplotlib 3.10.0 & 3.10.1.
No error is raised with 3.9.4.
Activity
rcomer commentedon Apr 29, 2025
Thanks for the clear report @nvaytet. This is already fixed ready for v3.10.2 by #29719.