Skip to content

Commit 9f3879a

Browse files
committed
Move title if x-axis is on the top of the figure
1 parent 5eb185f commit 9f3879a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ def set_title(self, label, fontdict=None, loc="center", **kwargs):
187187
if fontdict is not None:
188188
title.update(fontdict)
189189
title.update(kwargs)
190+
if self.xaxis.get_label_position() is 'top':
191+
print(self.xaxis.get_label().get_position())
192+
title.set_y(1.1)
190193
return title
191194

192195
def get_xlabel(self):

0 commit comments

Comments
 (0)