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
When a scatter plot is created with (x=[NaN], y=[NaN]), a call to legend will raise a ValueError exception. The error appears when the two conditions are met while calling scatter:
The length of s= (marker size) is equal to the data length
No points are plotted, i. e. for each index, x[index] or y[index] is NAN or INFINITY
For example, this will also raise the exception: scatter([NAN, 2], [3, NAN], marker="o", s=[3, 4])
burak1000 provided more information about the issue on SO!
The text was updated successfully, but these errors were encountered:
7hibault
changed the title
One element NaN scatter plots raising ValueError exception when trying to add a legend
ValueError exception when plotting a legend on an empty scatter graph with marker size = data length
Apr 22, 2015
tacaswell
added a commit
to tacaswell/matplotlib
that referenced
this issue
Jul 16, 2015
Oddly, this works correctly with empty lists, but not with nans floating around, but I suspect that this is due to some nastyness in handling the normalization of the input to scatter.
Issue raised on Stack Overflow by burak1000: Legends for scatter plots with NANs in matplotlib
When a scatter plot is created with
(x=[NaN], y=[NaN])
, a call to legend will raise aValueError
exception. The error appears when the two conditions are met while calling scatter:For example, this will also raise the exception:
scatter([NAN, 2], [3, NAN], marker="o", s=[3, 4])
burak1000 provided more information about the issue on SO!
The text was updated successfully, but these errors were encountered: