Skip to content

Commit 034904d

Browse files
authored
Merge branch 'matplotlib:main' into add-3d-plots-to-gallery
2 parents 981c991 + 4965500 commit 034904d

File tree

5 files changed

+22
-5
lines changed

5 files changed

+22
-5
lines changed

.github/workflows/cibuildsdist.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,9 @@ jobs:
6262

6363
- name: Check version number is not 0
6464
run: python ./ci/check_version_number.py
65+
66+
- name: Install twine
67+
run: pip install twine
68+
69+
- name: Check README rendering for PyPI
70+
run: twine check dist/*
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Colorbars for orphaned mappables are deprecated, but no longer raise
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Before 3.6.0, Colorbars for mappables that do not have a parent axes would
5+
steal space from the current Axes. 3.6.0 raised an error on this, but without
6+
a deprecation cycle. For 3.6.1 this is reverted, the current axes is used,
7+
but a deprecation warning is shown instead. In this undetermined case users
8+
and libraries should explicitly specify what axes they want space to be stolen
9+
from: ``fig.colorbar(mappable, ax=plt.gca())``.

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5272,7 +5272,7 @@ def _fill_between_x_or_y(
52725272
raise ValueError(f"where size ({where.size}) does not match "
52735273
f"{ind_dir} size ({ind.size})")
52745274
where = where & ~functools.reduce(
5275-
np.logical_or, map(np.ma.getmask, [ind, dep1, dep2]))
5275+
np.logical_or, map(np.ma.getmaskarray, [ind, dep1, dep2]))
52765276

52775277
ind, dep1, dep2 = np.broadcast_arrays(
52785278
np.atleast_1d(ind), dep1, dep2, subok=True)

lib/matplotlib/tests/test_axes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,13 +491,15 @@ def test_subclass_clear_cla():
491491
# Note, we cannot use mocking here as we want to be sure that the
492492
# superclass fallback does not recurse.
493493

494-
with pytest.warns(match='Overriding `Axes.cla`'):
494+
with pytest.warns(PendingDeprecationWarning,
495+
match='Overriding `Axes.cla`'):
495496
class ClaAxes(Axes):
496497
def cla(self):
497498
nonlocal called
498499
called = True
499500

500-
with pytest.warns(match='Overriding `Axes.cla`'):
501+
with pytest.warns(PendingDeprecationWarning,
502+
match='Overriding `Axes.cla`'):
501503
class ClaSuperAxes(Axes):
502504
def cla(self):
503505
nonlocal called

lib/matplotlib/tests/test_colors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def test_double_register_builtin_cmap():
117117
mpl.colormaps[name], name=name, force=True
118118
)
119119
with pytest.raises(ValueError, match='A colormap named "viridis"'):
120-
with pytest.warns():
120+
with pytest.warns(PendingDeprecationWarning):
121121
cm.register_cmap(name, mpl.colormaps[name])
122122
with pytest.warns(UserWarning):
123123
# TODO is warning more than once!
@@ -128,7 +128,7 @@ def test_unregister_builtin_cmap():
128128
name = "viridis"
129129
match = f'cannot unregister {name!r} which is a builtin colormap.'
130130
with pytest.raises(ValueError, match=match):
131-
with pytest.warns():
131+
with pytest.warns(PendingDeprecationWarning):
132132
cm.unregister_cmap(name)
133133

134134

0 commit comments

Comments
 (0)