-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Milestone
Description
scatter plots are removing points with valid x/y coordinates but invalid color value. As colormaps have a special setting for what color should be used in case of invalid data points (used e.g. in imshow array plots) maybe these points should indeed be plotted and plotted with the specified "bad value" color.
Consider this example:
import matplotlib.pyplot as plt
from matplotlib.cm import spring
import numpy as np
spring.set_bad("k", 1)
colors = np.array([1, 3, 9, np.nan])
x = [0, 1, 2, 3]
plt.figure()
plt.imshow(colors.reshape((2, 2)), interpolation="nearest", cmap=spring)
plt.figure()
plt.scatter(x, x, s=1e4, c=colors, cmap=spring)
plt.show()The right-hand side scatter plot is not showing the x=3, y=3, color=np.nan data point:
