Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Milestone
Description
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
importmatplotlib.pyplotaspltplt.scatter([0,1], [0,1],c=[(255,0,0), (0,255,0)])
Actual outcome
ValueError:'c'argumenthas2elements,whichisnotacceptableforusewith'x'withsize2,'y'withsize2.
Edit:
ValueError:RGBAvaluesshouldbewithin0-1range
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:
ValueError:RGBAvaluesshouldbewithin0-1range
Matplotlib version
- Operating system: Windows 10
- Matplotlib version: 3.1.2
- Matplotlib backend: Qt5Agg
- Python version: 3.7.3
Installed matplotlib from conda