Skip to content

Commit 527fd07

Browse files
committed
Merge pull request matplotlib#1663 from dmcdougall/fix_suptitle
Fix suptitle
2 parents dc37c49 + 8717373 commit 527fd07

File tree

6 files changed

+570
-2
lines changed

6 files changed

+570
-2
lines changed

lib/matplotlib/figure.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ def __init__(self,
319319

320320
self._hold = rcParams['axes.hold']
321321
self.canvas = None
322+
self._suptitle = None
322323

323324
if subplotpars is None:
324325
subplotpars = SubplotParams()
@@ -491,8 +492,14 @@ def suptitle(self, t, **kwargs):
491492
if ('verticalalignment' not in kwargs) and ('va' not in kwargs):
492493
kwargs['verticalalignment'] = 'top'
493494

494-
t = self.text(x, y, t, **kwargs)
495-
return t
495+
sup = self.text(x, y, t, **kwargs)
496+
if self._suptitle is not None:
497+
self._suptitle.set_text(t)
498+
self._suptitle.set_position((x, y))
499+
self._suptitle.update_from(sup)
500+
else:
501+
self._suptitle = sup
502+
return self._suptitle
496503

497504
def set_canvas(self, canvas):
498505
"""
Binary file not shown.
Loading

0 commit comments

Comments
 (0)