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

Skip to content

Commit 90e65fe

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

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ 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+
title.set_y(1.1)
190192
return title
191193

192194
def get_xlabel(self):

0 commit comments

Comments
 (0)