Skip to content

Commit d366cbb

Browse files
authored
Merge branch 'matplotlib:main' into documentation_1
2 parents ba5d33c + 61ed3f4 commit d366cbb

File tree

28 files changed

+207
-160
lines changed

28 files changed

+207
-160
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ jobs:
103103
libgirepository1.0-dev \
104104
libsdl2-2.0-0 \
105105
libxkbcommon-x11-0 \
106+
libxcb-cursor0 \
106107
libxcb-icccm4 \
107108
libxcb-image0 \
108109
libxcb-keysyms1 \

ci/mypy-stubtest-allowlist.txt

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -64,38 +64,9 @@ matplotlib.ticker.MultipleLocator.set_params
6464
matplotlib.text.Annotation.get_window_extent
6565

6666
# Inconsistent super/sub class parameter name (maybe rename for consistency)
67-
matplotlib.axis.Axis.set_clip_path
68-
matplotlib.axis.Tick.set_clip_path
69-
matplotlib.image.NonUniformImage.set_filternorm
70-
matplotlib.image.NonUniformImage.set_filterrad
71-
matplotlib.projections.geo.AitoffAxes.AitoffTransform.transform_non_affine
72-
matplotlib.projections.geo.AitoffAxes.InvertedAitoffTransform.transform_non_affine
73-
matplotlib.projections.geo.HammerAxes.HammerTransform.transform_non_affine
74-
matplotlib.projections.geo.HammerAxes.InvertedHammerTransform.transform_non_affine
75-
matplotlib.projections.geo.LambertAxes.InvertedLambertTransform.transform_non_affine
76-
matplotlib.projections.geo.LambertAxes.LambertTransform.transform_non_affine
77-
matplotlib.projections.geo.MollweideAxes.InvertedMollweideTransform.transform_non_affine
78-
matplotlib.projections.geo.MollweideAxes.MollweideTransform.transform_non_affine
79-
matplotlib.projections.polar.InvertedPolarTransform.transform_non_affine
80-
matplotlib.projections.polar.PolarTransform.transform_non_affine
8167
matplotlib.projections.polar.RadialLocator.nonsingular
82-
matplotlib.scale.AsinhTransform.transform_non_affine
83-
matplotlib.scale.InvertedAsinhTransform.transform_non_affine
84-
matplotlib.scale.InvertedSymmetricalLogTransform.transform_non_affine
85-
matplotlib.scale.LogisticTransform.transform_non_affine
86-
matplotlib.scale.LogitTransform.transform_non_affine
87-
matplotlib.scale.SymmetricalLogTransform.transform_non_affine
88-
matplotlib.table.Cell.set_transform
8968
matplotlib.ticker.LogLocator.nonsingular
9069
matplotlib.ticker.LogitLocator.nonsingular
91-
matplotlib.transforms.Affine2DBase.transform_affine
92-
matplotlib.transforms.AffineBase.transform_non_affine
93-
matplotlib.transforms.BlendedGenericTransform.transform_non_affine
94-
matplotlib.transforms.CompositeGenericTransform.transform_affine
95-
matplotlib.transforms.CompositeGenericTransform.transform_non_affine
96-
matplotlib.transforms.IdentityTransform.transform_affine
97-
matplotlib.transforms.IdentityTransform.transform_non_affine
98-
matplotlib.transforms.IdentityTransform.transform
9970

10071
# Stdlib/Enum considered inconsistent (no fault of ours, I don't think)
10172
matplotlib.backend_bases._Mode.__new__
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Method parameters renamed to match base classes
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
The only parameter of ``transform_affine`` and ``transform_non_affine`` in ``Transform`` subclasses is renamed
5+
to *values*.
6+
7+
The *points* parameter of ``transforms.IdentityTransform.transform`` is renamed to *values*.
8+
9+
The *trans* parameter of ``table.Cell.set_transform`` is renamed to *t* consistently with
10+
`.Artist.set_transform`.
11+
12+
The *clippath* parameters of ``axis.Axis.set_clip_path`` and ``axis.Tick.set_clip_path`` are
13+
renamed to *path* consistently with `.Artist.set_clip_path`.
14+
15+
The *s* parameter of ``images.NonUniformImage.set_filternorm`` is renamed to *filternorm*
16+
consistently with ```_ImageBase.set_filternorm``.
17+
18+
The *s* parameter of ``images.NonUniformImage.set_filterrad`` is renamed to *filterrad*
19+
consistently with ```_ImageBase.set_filterrad``.

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ dependencies:
4949
- flake8-docstrings>=1.4.0
5050
- gtk4
5151
- ipykernel
52-
- nbconvert[execute]!=6.0.0,!=6.0.1
52+
- nbconvert[execute]!=6.0.0,!=6.0.1,!=7.3.0
5353
- nbformat!=5.0.0,!=5.0.1
5454
- pandas!=0.25.0
5555
- psutil

galleries/users_explain/text/README.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
Text
66
----
77

8-
matplotlib has extensive text support, including support for
9-
mathematical expressions, truetype support for raster and
8+
Matplotlib has extensive text support, including support for
9+
mathematical expressions, TrueType support for raster and
1010
vector outputs, newline separated text with arbitrary
1111
rotations, and Unicode support. These tutorials cover
1212
the basics of working with text in Matplotlib.
13+
14+
For even more information see the :ref:`examples page <text_labels_and_annotations>`.

lib/matplotlib/axes/_axes.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def legend(self, *args, **kwargs):
314314
*args,
315315
**kwargs)
316316
if len(extra_args):
317-
raise TypeError('legend only accepts two non-keyword arguments')
317+
_api.nargs_error('legend', '0-2', len(args))
318318
self.legend_ = mlegend.Legend(self, handles, labels, **kwargs)
319319
self.legend_._remove_method = self._remove_legend
320320
return self.legend_
@@ -2830,11 +2830,11 @@ def broken_barh(self, xranges, yrange, **kwargs):
28302830
Parameters
28312831
----------
28322832
xranges : sequence of tuples (*xmin*, *xwidth*)
2833-
The x-positions and extends of the rectangles. For each tuple
2833+
The x-positions and extents of the rectangles. For each tuple
28342834
(*xmin*, *xwidth*) a rectangle is drawn from *xmin* to *xmin* +
28352835
*xwidth*.
28362836
yrange : (*ymin*, *yheight*)
2837-
The y-position and extend for all the rectangles.
2837+
The y-position and extent for all the rectangles.
28382838
28392839
Returns
28402840
-------
@@ -2970,8 +2970,7 @@ def stem(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0,
29702970
which inspired this method.
29712971
"""
29722972
if not 1 <= len(args) <= 3:
2973-
raise TypeError('stem expected between 1 or 3 positional '
2974-
f'arguments, got {args}')
2973+
_api.nargs_error('stem', '1-3', len(args))
29752974
_api.check_in_list(['horizontal', 'vertical'], orientation=orientation)
29762975

29772976
if len(args) == 1:
@@ -4455,6 +4454,18 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
44554454
The marker size in points**2 (typographic points are 1/72 in.).
44564455
Default is ``rcParams['lines.markersize'] ** 2``.
44574456
4457+
The linewidth and edgecolor can visually interact with the marker
4458+
size, and can lead to artifacts if the marker size is smaller than
4459+
the linewidth.
4460+
4461+
If the linewidth is greater than 0 and the edgecolor is anything
4462+
but *'none'*, then the effective size of the marker will be
4463+
increased by half the linewidth because the stroke will be centered
4464+
on the edge of the shape.
4465+
4466+
To eliminate the marker edge either set *linewidth=0* or
4467+
*edgecolor='none'*.
4468+
44584469
c : array-like or list of colors or color, optional
44594470
The marker colors. Possible values:
44604471
@@ -6371,7 +6382,7 @@ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
63716382
else:
63726383
raise TypeError("arguments do not match valid signatures")
63736384
else:
6374-
raise TypeError("need 1 argument or 3 arguments")
6385+
_api.nargs_error('pcolorfast', '1 or 3', len(args))
63756386

63766387
if style == "quadmesh":
63776388
# data point in each cell is value at lower left corner

lib/matplotlib/axis.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,11 @@ def get_children(self):
229229
self.gridline, self.label1, self.label2]
230230
return children
231231

232-
def set_clip_path(self, clippath, transform=None):
232+
@_api.rename_parameter("3.8", "clippath", "path")
233+
def set_clip_path(self, path, transform=None):
233234
# docstring inherited
234-
super().set_clip_path(clippath, transform)
235-
self.gridline.set_clip_path(clippath, transform)
235+
super().set_clip_path(path, transform)
236+
self.gridline.set_clip_path(path, transform)
236237
self.stale = True
237238

238239
def contains(self, mouseevent):
@@ -1079,10 +1080,11 @@ def _translate_tick_params(kw, reverse=False):
10791080
kwtrans.update(kw_)
10801081
return kwtrans
10811082

1082-
def set_clip_path(self, clippath, transform=None):
1083-
super().set_clip_path(clippath, transform)
1083+
@_api.rename_parameter("3.8", "clippath", "path")
1084+
def set_clip_path(self, path, transform=None):
1085+
super().set_clip_path(path, transform)
10841086
for child in self.majorTicks + self.minorTicks:
1085-
child.set_clip_path(clippath, transform)
1087+
child.set_clip_path(path, transform)
10861088
self.stale = True
10871089

10881090
def get_view_interval(self):

lib/matplotlib/backends/backend_cairo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
try:
1616
import cairo
1717
if cairo.version_info < (1, 14, 0): # Introduced set_device_scale.
18-
raise ImportError
18+
raise ImportError(f"Cairo backend requires cairo>=1.14.0, "
19+
f"but only {cairo.version_info} is available")
1920
except ImportError:
2021
try:
2122
import cairocffi as cairo

lib/matplotlib/backends/backend_gtk3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
except ValueError as e:
2222
# in this case we want to re-raise as ImportError so the
2323
# auto-backend selection logic correctly skips.
24-
raise ImportError from e
24+
raise ImportError(e) from e
2525

2626
from gi.repository import Gio, GLib, GObject, Gtk, Gdk
2727
from . import _backend_gtk

lib/matplotlib/backends/backend_gtk4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
except ValueError as e:
2121
# in this case we want to re-raise as ImportError so the
2222
# auto-backend selection logic correctly skips.
23-
raise ImportError from e
23+
raise ImportError(e) from e
2424

2525
from gi.repository import Gio, GLib, Gtk, Gdk, GdkPixbuf
2626
from . import _backend_gtk

0 commit comments

Comments
 (0)