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
Bug summary
When colors passed to a plot are provided as tuples in the range [0, 255] instead of [0, 1], the error raised relates to the shape of the data (which is correct), not the values of the data.
The correct error is being raised from colors = mcolors.to_rgba_array(c) in _axes.py. However, this is caught in _axes.py and the incorrect ValueError is raised here.
The incorrect error is raised because valid_shape is False, which is being set here. This is caused by c.size == xsize evaluating to False when c is an array of tuples because c.size will be number of tuple X size of tuple, so for c=[(255, 0, 0), (0, 255, 0)], c.size == 6 when that statement is intended to check if it is 2.
I haven't had the time to work out exactly what the intention of this bit of the code is, so have not yet found a solution.
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug summary
When colors passed to a plot are provided as tuples in the range
[0, 255]
instead of[0, 1]
, the error raised relates to the shape of the data (which is correct), not the values of the data.Code for reproduction
Actual outcome
Edit:
is also raised, however it is less prominent than the "size" error, which should not be raised at all
Expected outcome
A single, specific error message:
Matplotlib version
Installed matplotlib from conda
The text was updated successfully, but these errors were encountered: