Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b3ee53d

Browse filesBrowse files
committed
ENH: rcparam for padding between axes and title
1 parent e24d5dc commit b3ee53d
Copy full SHA for b3ee53d

File tree

Expand file treeCollapse file tree

4 files changed

+6
-2
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+6
-2
lines changed

‎lib/matplotlib/axes/_base.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_base.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,9 +1046,10 @@ def cla(self):
10461046
size=rcParams['axes.titlesize'],
10471047
weight=rcParams['axes.titleweight']
10481048
)
1049-
1049+
title_offset_points = rcParams['axes.titlepad']
10501050
self.titleOffsetTrans = mtransforms.ScaledTranslation(
1051-
0.0, 9.0 / 72.0, self.figure.dpi_scale_trans)
1051+
0.0, title_offset_points / 72.0,
1052+
self.figure.dpi_scale_trans)
10521053
self.title = mtext.Text(
10531054
x=0.5, y=1.0, text='',
10541055
fontproperties=props,

‎lib/matplotlib/mpl-data/stylelib/classic.mplstyle

Copy file name to clipboardExpand all lines: lib/matplotlib/mpl-data/stylelib/classic.mplstyle
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ axes.grid : False # display grid or not
179179
axes.grid.which : major
180180
axes.grid.axis : both
181181
axes.titlesize : large # fontsize of the axes title
182+
axes.titlepad : 5.0 # pad between axes and title in points
182183
axes.titleweight : normal # font weight for axes title
183184
axes.labelsize : medium # fontsize of the x any y labels
184185
axes.labelpad : 5.0 # space between label and axis

‎lib/matplotlib/rcsetup.py

Copy file name to clipboardExpand all lines: lib/matplotlib/rcsetup.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,7 @@ def validate_hist_bins(s):
10361036
'axes.titlesize': ['large', validate_fontsize], # fontsize of the
10371037
# axes title
10381038
'axes.titleweight': ['normal', six.text_type], # font weight of axes title
1039+
'axes.titlepad': [9.0, validate_float], # pad from axes top to title in points
10391040
'axes.grid': [False, validate_bool], # display grid or not
10401041
'axes.grid.which': ['major', validate_axis_locator], # set wether the gid are by
10411042
# default draw on 'major'

‎matplotlibrc.template

Copy file name to clipboardExpand all lines: matplotlibrc.template
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ backend : $TEMPLATE_BACKEND
297297
#axes.linewidth : 1.0 # edge linewidth
298298
#axes.grid : False # display grid or not
299299
#axes.titlesize : large # fontsize of the axes title
300+
#axes.titlepad : 9.0 # pad between axes and title in points
300301
#axes.labelsize : medium # fontsize of the x any y labels
301302
#axes.labelpad : 5.0 # space between label and axis
302303
#axes.labelweight : normal # weight of the x and y labels

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.