Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d3ebdd6

Browse files
committed
:s/plotinvalid/plotnonfinite.
The name is a reference to the standard isfinite() function.
1 parent 98e4bca commit d3ebdd6

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

doc/api/next_api_changes/2018-11-14-AL-scatter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ by `PathCollection.get_array`)
99

1010
Such points are now included, but masked out by returning a masked array.
1111

12-
If the *plotinvalid* kwarg to `~.Axes.scatter` is set, then points with
12+
If the *plotnonfinite* kwarg to `~.Axes.scatter` is set, then points with
1313
nonfinite values are plotted using the bad color of the `PathCollection`\ 's
1414
colormap (as set by `Colormap.set_bad`).

lib/matplotlib/axes/_axes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4169,7 +4169,7 @@ def _parse_scatter_color_args(self, c, edgecolors, kwargs, xshape, yshape):
41694169
label_namer="y")
41704170
def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
41714171
vmin=None, vmax=None, alpha=None, linewidths=None,
4172-
verts=None, edgecolors=None, *, plotinvalid=False,
4172+
verts=None, edgecolors=None, *, plotnonfinite=False,
41734173
**kwargs):
41744174
"""
41754175
A scatter plot of *y* vs *x* with varying marker size and/or color.
@@ -4246,8 +4246,8 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
42464246
For non-filled markers, the *edgecolors* kwarg is ignored and
42474247
forced to 'face' internally.
42484248
4249-
plotinvalid : boolean, optional, default: False
4250-
Set to plot valid points with invalid color, in conjunction with
4249+
plotnonfinite : boolean, optional, default: False
4250+
Set to plot points with nonfinite *c*, in conjunction with
42514251
`~matplotlib.colors.Colormap.set_bad`.
42524252
42534253
Returns
@@ -4302,7 +4302,7 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
43024302
self._parse_scatter_color_args(c, edgecolors, kwargs,
43034303
xshape, yshape)
43044304

4305-
if plotinvalid and colors is None:
4305+
if plotnonfinite and colors is None:
43064306
c = np.ma.masked_invalid(c)
43074307
x, y, s, colors, edgecolors, linewidths = \
43084308
cbook._combine_masks(x, y, s, colors, edgecolors, linewidths)

lib/matplotlib/pyplot.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2835,12 +2835,13 @@ def quiverkey(Q, X, Y, U, label, **kw):
28352835
def scatter(
28362836
x, y, s=None, c=None, marker=None, cmap=None, norm=None,
28372837
vmin=None, vmax=None, alpha=None, linewidths=None, verts=None,
2838-
edgecolors=None, *, plotinvalid=False, data=None, **kwargs):
2838+
edgecolors=None, *, plotnonfinite=False, data=None, **kwargs):
28392839
__ret = gca().scatter(
28402840
x, y, s=s, c=c, marker=marker, cmap=cmap, norm=norm,
28412841
vmin=vmin, vmax=vmax, alpha=alpha, linewidths=linewidths,
2842-
verts=verts, edgecolors=edgecolors, plotinvalid=plotinvalid,
2843-
**({"data": data} if data is not None else {}), **kwargs)
2842+
verts=verts, edgecolors=edgecolors,
2843+
plotnonfinite=plotnonfinite, **({"data": data} if data is not
2844+
None else {}), **kwargs)
28442845
sci(__ret)
28452846
return __ret
28462847

lib/matplotlib/tests/test_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,7 @@ def test_scatter_invalid_color(self, fig_test, fig_ref):
17531753
# stamping fast path, which would result in slightly offset markers.
17541754
ax.scatter(range(4), range(4),
17551755
c=[1, np.nan, 2, np.nan], s=[1, 2, 3, 4],
1756-
cmap=cmap, plotinvalid=True)
1756+
cmap=cmap, plotnonfinite=True)
17571757
ax = fig_ref.subplots()
17581758
cmap = plt.get_cmap("viridis", 16)
17591759
ax.scatter([0, 2], [0, 2], c=[1, 2], s=[1, 3], cmap=cmap)

0 commit comments

Comments
 (0)