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

Skip to content

Commit 98081a8

Browse files
Merge branch 'master' into Bugfix-16583
2 parents 76d85e5 + d7ba944 commit 98081a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+715
-2213
lines changed

doc/api/next_api_changes/behaviour.rst

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,20 @@ deprecation warning.
100100

101101
Previously setting the *ecolor* would turn off automatic color cycling for the plot, leading to the
102102
the lines and markers defaulting to whatever the first color in the color cycle was in the case of
103-
multiple plot calls.
103+
multiple plot calls.
104+
105+
`.rcsetup.validate_color_for_prop_cycle` now always raises TypeError for bytes input
106+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
107+
It previously raised `TypeError`, **except** when the input was of the form
108+
``b"C[number]"`` in which case it raised a ValueError.
109+
110+
`.FigureCanvasPS.print_ps` and `.FigureCanvasPS.print_eps` no longer apply edgecolor and facecolor
111+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112+
113+
These methods now assume that the figure edge and facecolor have been correctly
114+
applied by `.FigureCanvasBase.print_figure`, as they are normally called
115+
through it.
116+
117+
This behavior is consistent with other figure saving methods
118+
(`.FigureCanvasAgg.print_png`, `.FigureCanvasPdf.print_pdf`,
119+
`.FigureCanvasSVG.print_svg`).

doc/api/next_api_changes/deprecations.rst

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,13 @@ Setting a `.Line2D`\'s pickradius (i.e. the tolerance for pick events
142142
and containment checks) via `.Line2D.set_picker` is deprecated. Use
143143
`.Line2D.set_pickradius` instead.
144144

145-
`.Line2D.set_picker` no longer sets the artist's custom-contain() check. Use
146-
``Line2D.set_contains`` instead.
145+
`.Line2D.set_picker` no longer sets the artist's custom-contain() check.
146+
147+
``Artist.set_contains``, ``Artist.get_contains``
148+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
149+
Setting a custom method overridding `.Artist.contains` is deprecated.
150+
There is no replacement, but you may still customize pick events using
151+
`.Artist.set_picker`.
147152

148153
`~matplotlib.colorbar.Colorbar` methods
149154
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -220,9 +225,11 @@ The following validators, defined in `.rcsetup`, are deprecated:
220225
``validate_movie_frame_fmt``, ``validate_axis_locator``,
221226
``validate_movie_html_fmt``, ``validate_grid_axis``,
222227
``validate_axes_titlelocation``, ``validate_toolbar``,
223-
``validate_ps_papersize``, ``validate_legend_log``. To test whether an rcParam
224-
value would be acceptable, one can test e.g. ``rc = RcParams(); rc[k] = v``
225-
raises an exception.
228+
``validate_ps_papersize``, ``validate_legend_loc``,
229+
``validate_bool_maybe_none``, ``validate_hinting``,
230+
``validate_movie_writers``.
231+
To test whether an rcParam value would be acceptable, one can test e.g. ``rc =
232+
RcParams(); rc[k] = v`` raises an exception.
226233

227234
Stricter rcParam validation
228235
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -247,3 +254,33 @@ mathtext glues
247254
~~~~~~~~~~~~~~
248255
The *copy* parameter of ``mathtext.Glue`` is deprecated (the underlying glue
249256
spec is now immutable). ``mathtext.GlueSpec`` is deprecated.
257+
258+
Signatures of `.Artist.draw` and `.Axes.draw`
259+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
260+
The *inframe* parameter to `.Axes.draw` is deprecated. Use
261+
`.Axes.redraw_in_frame` instead.
262+
263+
Not passing the *renderer* parameter to `.Axes.draw` is deprecated. Use
264+
``axes.draw_artist(axes)`` instead.
265+
266+
These changes make the signature of the ``draw`` (``artist.draw(renderer)``)
267+
method consistent across all artists; thus, additional parameters to
268+
`.Artist.draw` are deprecated.
269+
270+
``DraggableBase.on_motion_blit``
271+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
272+
This method is deprecated. `.DraggableBase.on_motion` now handles both the
273+
blitting and the non-blitting cases.
274+
275+
Passing the dash offset as None
276+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
277+
Fine control of dash patterns can be achieved by passing an ``(offset,
278+
(on-length, off-length, on-length, off-length, ...))`` pair as the linestyle
279+
property of `.Line2D` and `.LineCollection`. Previously, certain APIs would
280+
accept ``offset = None`` as a synonym for ``offset = 0``, but this was never
281+
universally implemented, e.g. for vector output. Support for ``offset = None``
282+
is deprecated, set the offset to 0 instead.
283+
284+
``RendererCairo.fontweights``, ``RendererCairo.fontangles``
285+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
286+
... are deprecated.

doc/sphinxext/github.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ def make_link_node(rawtext, app, type, slug, options):
3939
base += '/'
4040
except AttributeError as err:
4141
raise ValueError(
42-
f'github_project_url configuration value is not set ({err})')
42+
f'github_project_url configuration value is not set '
43+
f'({err})') from err
4344

4445
ref = base + type + '/' + slug + '/'
4546
set_classes(options)
@@ -137,7 +138,8 @@ def ghcommit_role(
137138
base += '/'
138139
except AttributeError as err:
139140
raise ValueError(
140-
f'github_project_url configuration value is not set ({err})')
141+
f'github_project_url configuration value is not set '
142+
f'({err})') from err
141143

142144
ref = base + text
143145
node = nodes.reference(rawtext, text[:6], refuri=ref, **options)

doc/sphinxext/missing_references.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ def _truncate_location(location):
139139
This allows for easy comparison even when line numbers chagne
140140
(as they do regularily).
141141
"""
142-
if ":" in location:
143-
return location.split(":", 1)[0]
144-
return location
142+
return location.split(":", 1)[0]
145143

146144

147145
def _warn_unused_missing_references(app):

examples/specialty_plots/leftventricle_bulleye.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def bullseye_plot(ax, data, seg_bold=None, cmap=None, norm=None):
7979
theta0 = theta[i * 128:i * 128 + 128] + np.deg2rad(60)
8080
theta0 = np.repeat(theta0[:, np.newaxis], 2, axis=1)
8181
z = np.ones((128, 2)) * data[i]
82-
ax.pcolormesh(theta0, r0, z, cmap=cmap, norm=norm)
82+
ax.pcolormesh(theta0, r0, z, cmap=cmap, norm=norm, shading='auto')
8383
if i + 1 in seg_bold:
8484
ax.plot(theta0, r0, '-k', lw=linewidth + 2)
8585
ax.plot(theta0[0], [r[2], r[3]], '-k', lw=linewidth + 1)
@@ -93,7 +93,7 @@ def bullseye_plot(ax, data, seg_bold=None, cmap=None, norm=None):
9393
theta0 = theta[i * 128:i * 128 + 128] + np.deg2rad(60)
9494
theta0 = np.repeat(theta0[:, np.newaxis], 2, axis=1)
9595
z = np.ones((128, 2)) * data[i + 6]
96-
ax.pcolormesh(theta0, r0, z, cmap=cmap, norm=norm)
96+
ax.pcolormesh(theta0, r0, z, cmap=cmap, norm=norm, shading='auto')
9797
if i + 7 in seg_bold:
9898
ax.plot(theta0, r0, '-k', lw=linewidth + 2)
9999
ax.plot(theta0[0], [r[1], r[2]], '-k', lw=linewidth + 1)
@@ -107,7 +107,7 @@ def bullseye_plot(ax, data, seg_bold=None, cmap=None, norm=None):
107107
theta0 = theta[i * 192:i * 192 + 192] + np.deg2rad(45)
108108
theta0 = np.repeat(theta0[:, np.newaxis], 2, axis=1)
109109
z = np.ones((192, 2)) * data[i + 12]
110-
ax.pcolormesh(theta0, r0, z, cmap=cmap, norm=norm)
110+
ax.pcolormesh(theta0, r0, z, cmap=cmap, norm=norm, shading='auto')
111111
if i + 13 in seg_bold:
112112
ax.plot(theta0, r0, '-k', lw=linewidth + 2)
113113
ax.plot(theta0[0], [r[0], r[1]], '-k', lw=linewidth + 1)
@@ -119,7 +119,7 @@ def bullseye_plot(ax, data, seg_bold=None, cmap=None, norm=None):
119119
r0 = np.repeat(r0[:, np.newaxis], theta.size, axis=1).T
120120
theta0 = np.repeat(theta[:, np.newaxis], 2, axis=1)
121121
z = np.ones((theta.size, 2)) * data[16]
122-
ax.pcolormesh(theta0, r0, z, cmap=cmap, norm=norm)
122+
ax.pcolormesh(theta0, r0, z, cmap=cmap, norm=norm, shading='auto')
123123
if 17 in seg_bold:
124124
ax.plot(theta0, r0, '-k', lw=linewidth + 2)
125125

examples/subplots_axes_and_figures/axes_margins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def f(t):
6262
ax2.use_sticky_edges = False
6363

6464
for ax, status in zip((ax1, ax2), ('Is', 'Is Not')):
65-
cells = ax.pcolor(x, y, x+y, cmap='inferno') # sticky
65+
cells = ax.pcolor(x, y, x+y, cmap='inferno', shading='auto') # sticky
6666
ax.add_patch(
6767
plt.Polygon(poly_coords, color='forestgreen', alpha=0.5)
6868
) # not sticky

examples/text_labels_and_annotations/legend_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def create_artists(self, legend, orig_handle,
153153
lw = orig_handle.get_linewidths()[i]
154154
except IndexError:
155155
lw = orig_handle.get_linewidths()[0]
156-
if dashes[0] is not None:
156+
if dashes[1] is not None:
157157
legline.set_dashes(dashes[1])
158158
legline.set_color(color)
159159
legline.set_transform(trans)

examples/user_interfaces/embedding_webagg_sgskip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
try:
1818
import tornado
19-
except ImportError:
20-
raise RuntimeError("This example requires tornado.")
19+
except ImportError as err:
20+
raise RuntimeError("This example requires tornado.") from err
2121
import tornado.web
2222
import tornado.httpserver
2323
import tornado.ioloop

examples/userdemo/colormap_normalizations_bounds.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

examples/userdemo/colormap_normalizations_custom.py

Lines changed: 0 additions & 50 deletions
This file was deleted.

examples/userdemo/colormap_normalizations_diverging.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

examples/userdemo/colormap_normalizations_lognorm.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

examples/userdemo/colormap_normalizations_power.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)