Closed
Description
Not sure if this behavior is intentional, but if one makes a scatter plot and provides an array for c which is longer than the number of x, y values, instead of raising an error from the arrays being unevenly shaped, it filled in the colors in incorrectly. Here is an example with the correct colors (because 'colors' is the same length as x and y)
x = np.linspace(0,10)
y = np.sin(x)
colors = x
plt.scatter(x,y, c=colors, cmap=mpl.cm.RdBu, s=100)
Here is one where colors is twice the size of x and y:
x = np.linspace(0,10)
y = np.sin(x)
colors = np.linspace(0,10, 100)
plt.scatter(x,y, c=colors, cmap=mpl.cm.RdBu, s=100)
Seems like the intended behavior would be to have an error thrown, or am I mistaken.
Metadata
Metadata
Assignees
Labels
No labels