Skip to content

Commit b2bd5db

Browse files
committed
Merge pull request matplotlib#3096 from pstjohn/axes-labelpad-rc
ENH : add rcparam for axes.labelpad commits from PR matplotlib#3096 merged manually to drop 1.4.x merge labelpad value was hardcoded
2 parents 6ed0425 + 0242b77 commit b2bd5db

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

lib/matplotlib/axis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ def __init__(self, axes, pickradius=15):
634634
self._smart_bounds = False
635635

636636
self.label = self._get_label()
637-
self.labelpad = 5
637+
self.labelpad = rcParams['axes.labelpad']
638638
self.offsetText = self._get_offset_text()
639639
self.majorTicks = []
640640
self.minorTicks = []

lib/matplotlib/rcsetup.py

+1
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ def __call__(self, s):
589589
# axis locator
590590
'axes.labelsize': ['medium', validate_fontsize], # fontsize of the
591591
# x any y labels
592+
'axes.labelpad': [5.0, validate_float], # space between label and axis
592593
'axes.labelweight': ['normal', six.text_type], # fontsize of the x any y labels
593594
'axes.labelcolor': ['k', validate_color], # color of axis label
594595
'axes.formatter.limits': [[-7, 7], validate_nseq_int(2)],

matplotlibrc.template

+1
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ backend : %(backend)s
241241
#axes.grid : False # display grid or not
242242
#axes.titlesize : large # fontsize of the axes title
243243
#axes.labelsize : medium # fontsize of the x any y labels
244+
#axes.labelpad : 5.0 # space between label and axis
244245
#axes.labelweight : normal # weight of the x and y labels
245246
#axes.labelcolor : black
246247
#axes.axisbelow : False # whether axis gridlines and ticks are below

0 commit comments

Comments
 (0)