Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f496c13

Browse filesBrowse files
committed
changes to keyword parameter ordering
The colorizer keyword now always follows *args
1 parent 39243e2 commit f496c13
Copy full SHA for f496c13

File tree

6 files changed

+21
-23
lines changed
Filter options

6 files changed

+21
-23
lines changed

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+10-10Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4709,8 +4709,8 @@ def invalid_shape_exception(csize, xsize):
47094709
label_namer="y")
47104710
@_docstring.interpd
47114711
def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
4712-
vmin=None, vmax=None, colorizer=None, alpha=None, linewidths=None, *,
4713-
edgecolors=None, plotnonfinite=False, **kwargs):
4712+
vmin=None, vmax=None, alpha=None, linewidths=None, *,
4713+
edgecolors=None, colorizer=None, plotnonfinite=False, **kwargs):
47144714
"""
47154715
A scatter plot of *y* vs. *x* with varying marker size and/or color.
47164716
@@ -4778,10 +4778,6 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
47784778
47794779
This parameter is ignored if *c* is RGB(A).
47804780
4781-
%(colorizer_doc)s
4782-
4783-
This parameter is ignored if *c* is RGB(A).
4784-
47854781
alpha : float, default: None
47864782
The alpha blending value, between 0 (transparent) and 1 (opaque).
47874783
@@ -4801,6 +4797,10 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
48014797
is determined like with 'face', i.e. from *c*, *colors*, or
48024798
*facecolors*.
48034799
4800+
%(colorizer_doc)s
4801+
4802+
This parameter is ignored if *c* is RGB(A).
4803+
48044804
plotnonfinite : bool, default: False
48054805
Whether to plot points with nonfinite *c* (i.e. ``inf``, ``-inf``
48064806
or ``nan``). If ``True`` the points are drawn with the *bad*
@@ -4997,10 +4997,10 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
49974997
@_docstring.dedent_interpd
49984998
def hexbin(self, x, y, C=None, gridsize=100, bins=None,
49994999
xscale='linear', yscale='linear', extent=None,
5000-
cmap=None, norm=None, vmin=None, vmax=None, colorizer=None,
5000+
cmap=None, norm=None, vmin=None, vmax=None,
50015001
alpha=None, linewidths=None, edgecolors='face',
50025002
reduce_C_function=np.mean, mincnt=None, marginals=False,
5003-
**kwargs):
5003+
colorizer=None, **kwargs):
50045004
"""
50055005
Make a 2D hexagonal binning plot of points *x*, *y*.
50065006
@@ -5111,8 +5111,6 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
51115111
51125112
%(vmin_vmax_doc)s
51135113
5114-
%(colorizer_doc)s
5115-
51165114
alpha : float between 0 and 1, optional
51175115
The alpha blending value, between 0 (transparent) and 1 (opaque).
51185116
@@ -5145,6 +5143,8 @@ def reduce_C_function(C: array) -> float
51455143
input. Changing *mincnt* will adjust the cutoff, and if set to 0 will
51465144
pass empty input to the reduction function.
51475145
5146+
%(colorizer_doc)s
5147+
51485148
data : indexable object, optional
51495149
DATA_PARAMETER_PLACEHOLDER
51505150

‎lib/matplotlib/axes/_axes.pyi

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.pyi
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,10 @@ class Axes(_AxesBase):
416416
norm: str | Normalize | None = ...,
417417
vmin: float | None = ...,
418418
vmax: float | None = ...,
419-
colorizer: Colorizer | None = ...,
420419
alpha: float | None = ...,
421420
linewidths: float | Sequence[float] | None = ...,
422421
edgecolors: Literal["face", "none"] | ColorType | Sequence[ColorType] | None = ...,
422+
colorizer: Colorizer | None = ...,
423423
plotnonfinite: bool = ...,
424424
data=...,
425425
**kwargs
@@ -439,14 +439,14 @@ class Axes(_AxesBase):
439439
norm: str | Normalize | None = ...,
440440
vmin: float | None = ...,
441441
vmax: float | None = ...,
442-
colorizer: Colorizer | None = ...,
443442
alpha: float | None = ...,
444443
linewidths: float | None = ...,
445444
edgecolors: Literal["face", "none"] | ColorType = ...,
446445
reduce_C_function: Callable[[np.ndarray | list[float]], float] = ...,
447446
mincnt: int | None = ...,
448447
marginals: bool = ...,
449448
data=...,
449+
colorizer: Colorizer | None = ...,
450450
**kwargs
451451
) -> PolyCollection: ...
452452
def arrow(

‎lib/matplotlib/collections.py

Copy file name to clipboardExpand all lines: lib/matplotlib/collections.py
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ def __init__(self, *,
157157
``Collection.set_{key}(val)`` for each key-value pair in *kwargs*.
158158
"""
159159

160-
mcolorizer.ColorizingArtist.__init__(self, mcolorizer._get_colorizer(cmap, norm,
161-
colorizer))
160+
super().__init__(mcolorizer._get_colorizer(cmap, norm, colorizer))
162161
# list of un-scaled dash patterns
163162
# this is needed scaling the dash pattern by linewidth
164163
self._us_linestyles = [(0, None)]

‎lib/matplotlib/colorizer.pyi

Copy file name to clipboardExpand all lines: lib/matplotlib/colorizer.pyi
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class _ColorizerInterface:
7777
def autoscale(self) -> None: ...
7878
def autoscale_None(self) -> None: ...
7979

80-
80+
8181
class ColorizingArtist(artist.Artist, _ColorizerInterface):
8282
callbacks: cbook.CallbackRegistry
8383
def __init__(

‎lib/matplotlib/image.py

Copy file name to clipboardExpand all lines: lib/matplotlib/image.py
+3-4Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,7 @@ def __init__(self, ax,
260260
interpolation_stage=None,
261261
**kwargs
262262
):
263-
mcolorizer.ColorizingArtist.__init__(self, mcolorizer._get_colorizer(cmap, norm,
264-
colorizer))
263+
super().__init__(mcolorizer._get_colorizer(cmap, norm, colorizer))
265264
if origin is None:
266265
origin = mpl.rcParams['image.origin']
267266
_api.check_in_list(["upper", "lower"], origin=origin)
@@ -333,7 +332,7 @@ def changed(self):
333332
Call this whenever the mappable is changed so observers can update.
334333
"""
335334
self._imcache = None
336-
mcolorizer.ColorizingArtist.changed(self)
335+
super().changed()
337336

338337
def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
339338
unsampled=False, round_to_pixel_border=True):
@@ -1358,7 +1357,7 @@ def make_image(self, renderer, magnification=1.0, unsampled=False):
13581357

13591358
def set_data(self, A):
13601359
"""Set the image array."""
1361-
mcolorizer.ColorizingArtist.set_array(self, A)
1360+
super().set_data(A)
13621361
self.stale = True
13631362

13641363

‎lib/matplotlib/pyplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/pyplot.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3393,13 +3393,13 @@ def hexbin(
33933393
norm: str | Normalize | None = None,
33943394
vmin: float | None = None,
33953395
vmax: float | None = None,
3396-
colorizer: Colorizer | None = None,
33973396
alpha: float | None = None,
33983397
linewidths: float | None = None,
33993398
edgecolors: Literal["face", "none"] | ColorType = "face",
34003399
reduce_C_function: Callable[[np.ndarray | list[float]], float] = np.mean,
34013400
mincnt: int | None = None,
34023401
marginals: bool = False,
3402+
colorizer: Colorizer | None = None,
34033403
*,
34043404
data=None,
34053405
**kwargs,
@@ -3417,13 +3417,13 @@ def hexbin(
34173417
norm=norm,
34183418
vmin=vmin,
34193419
vmax=vmax,
3420-
colorizer=colorizer,
34213420
alpha=alpha,
34223421
linewidths=linewidths,
34233422
edgecolors=edgecolors,
34243423
reduce_C_function=reduce_C_function,
34253424
mincnt=mincnt,
34263425
marginals=marginals,
3426+
colorizer=colorizer,
34273427
**({"data": data} if data is not None else {}),
34283428
**kwargs,
34293429
)
@@ -3918,11 +3918,11 @@ def scatter(
39183918
norm: str | Normalize | None = None,
39193919
vmin: float | None = None,
39203920
vmax: float | None = None,
3921-
colorizer: Colorizer | None = None,
39223921
alpha: float | None = None,
39233922
linewidths: float | Sequence[float] | None = None,
39243923
*,
39253924
edgecolors: Literal["face", "none"] | ColorType | Sequence[ColorType] | None = None,
3925+
colorizer: Colorizer | None = None,
39263926
plotnonfinite: bool = False,
39273927
data=None,
39283928
**kwargs,
@@ -3937,10 +3937,10 @@ def scatter(
39373937
norm=norm,
39383938
vmin=vmin,
39393939
vmax=vmax,
3940-
colorizer=colorizer,
39413940
alpha=alpha,
39423941
linewidths=linewidths,
39433942
edgecolors=edgecolors,
3943+
colorizer=colorizer,
39443944
plotnonfinite=plotnonfinite,
39453945
**({"data": data} if data is not None else {}),
39463946
**kwargs,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.