Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a59d1d2
Backport PR #30960: SVG backend - handle font weight as integer
steveberardi Jan 14, 2026
58d5aea
Merge pull request #30964 from meeseeksmachine/auto-backport-of-pr-30…
timhoffm Jan 14, 2026
bc44318
Backport PR #30952: DOC: Tutorial on API shortcuts
timhoffm Jan 15, 2026
521df0b
Merge pull request #30965 from meeseeksmachine/auto-backport-of-pr-30…
timhoffm Jan 15, 2026
8c7d40f
Backport PR #30969: DOC: Simplify barh() example
rcomer Jan 15, 2026
df313af
Merge pull request #30971 from meeseeksmachine/auto-backport-of-pr-30…
rcomer Jan 15, 2026
89a35d8
Backport PR #30985: MNT: do not assign a numpy array shape
scottshambaugh Jan 17, 2026
50d13e4
Merge pull request #30986 from meeseeksmachine/auto-backport-of-pr-30…
timhoffm Jan 17, 2026
2deb54c
Backport PR #31035: DOCS: Fix typo in time array step size comment
rcomer Jan 26, 2026
8db8148
Merge pull request #31036 from meeseeksmachine/auto-backport-of-pr-31…
rcomer Jan 26, 2026
313a44d
Backport PR #31075: Fix remove method for figure title and xy-labels
QuLogic Feb 4, 2026
b9d7e7f
Backport PR #31153: TST: Use correct method of clearing mock objects
ksunden Feb 13, 2026
cc7fe5a
Merge pull request #31154 from meeseeksmachine/auto-backport-of-pr-31…
timhoffm Feb 13, 2026
ef19bdc
Backport PR #31278: Fix `clabel` manual argument not accepting unit-t…
aman-coder03 Mar 11, 2026
f32af1d
Backport PR #31323: FIX: Prevent crash when removing a subfigure cont…
Vikash-Kumar-23 Mar 27, 2026
6aac3da
Backport PR #31401: BLD: Temporarily pin setuptools-scm<10
QuLogic Mar 27, 2026
9220b77
Merge pull request #31418 from rcomer/pin-setuptools-scm-backport
timhoffm Mar 29, 2026
3c91aec
Backport PR #31420: Fix outdated Savannah URL for freetype download
timhoffm Mar 29, 2026
b9163f8
Merge pull request #31421 from meeseeksmachine/auto-backport-of-pr-31…
rcomer Mar 29, 2026
51c85f7
Merge pull request #31411 from meeseeksmachine/auto-backport-of-pr-31…
rcomer Mar 29, 2026
69e6954
Backport PR #31437: mathtext: Fix type inconsistency with fontmaps
tacaswell Apr 2, 2026
cada119
Bump mimimum Ubuntu Version on Azure because 20.04 is EOL
ksunden Apr 3, 2026
45ac295
Merge pull request #31445 from ksunden/auto-backport-of-pr-31437-on-v…
QuLogic Apr 7, 2026
614abdd
Backport PR #31504: Re-order variants to prioritize narrower types
QuLogic Apr 16, 2026
6e203dc
Merge pull request #31511 from meeseeksmachine/auto-backport-of-pr-31…
ksunden Apr 17, 2026
2da812c
Backport PR #31020: DOC: Fix doc builds with Sphinx 9
timhoffm Jan 24, 2026
52059e4
Merge pull request #31520 from meeseeksmachine/auto-backport-of-pr-31…
ksunden Apr 21, 2026
851f769
Merge pull request #31280 from meeseeksmachine/auto-backport-of-pr-31…
ksunden Apr 21, 2026
e3fb541
Merge pull request #31078 from meeseeksmachine/auto-backport-of-pr-31…
ksunden Apr 21, 2026
acc6024
Merge pull request #31282 from scottshambaugh/tex_no_shell
WeatherGod Mar 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,17 @@ def _suplabels(self, t, info, **kwargs):
else:
suplab = self.text(x, y, t, **kwargs)
setattr(self, info['name'], suplab)
suplab._remove_method = functools.partial(self._remove_suplabel,
name=info['name'])

suplab._autopos = autopos
self.stale = True
return suplab

def _remove_suplabel(self, label, name):
self.texts.remove(label)
setattr(self, name, None)

@_docstring.Substitution(x0=0.5, y0=0.98, name='super title', ha='center',
va='top', rc='title')
@_docstring.copy(_suplabels)
Expand Down
22 changes: 22 additions & 0 deletions lib/matplotlib/tests/test_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,28 @@ def test_get_suptitle_supxlabel_supylabel():
assert fig.get_supylabel() == 'supylabel'


def test_remove_suptitle_supxlabel_supylabel():
fig = plt.figure()

title = fig.suptitle('suptitle')
xlabel = fig.supxlabel('supxlabel')
ylabel = fig.supylabel('supylabel')

assert len(fig.texts) == 3
assert fig._suptitle is not None
assert fig._supxlabel is not None
assert fig._supylabel is not None

title.remove()
assert fig._suptitle is None
xlabel.remove()
assert fig._supxlabel is None
ylabel.remove()
assert fig._supylabel is None

assert not fig.texts


@image_comparison(['alpha_background'],
# only test png and svg. The PDF output appears correct,
# but Ghostscript does not preserve the background color.
Expand Down
Loading