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

Skip to content

Commit f9dab5f

Browse files
committed
Merge remote-tracking branch 'mdboom/332_axes_labelweight'
manually merged CHANGELOG
2 parents 6270f36 + 6b7c742 commit f9dab5f

5 files changed

Lines changed: 18 additions & 5 deletions

File tree

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
set_theta_zero_location to polar axes to control the
66
location of 0 and directionality of theta. - MGD
77

8+
2011-06-22 Add axes.labelweight parameter to set font weight to axis
9+
labels - MGD.
10+
811
2011-06-16 Added *bottom* keyword parameter for the stem command.
912
Also, implemented a legend handler for the stem plot.
1013
- JJL

lib/matplotlib/axis.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,8 @@ def _get_label(self):
15521552
# time by _update_label_positions)
15531553
label = mtext.Text(x=0.5, y=0,
15541554
fontproperties = font_manager.FontProperties(
1555-
size=rcParams['axes.labelsize']),
1555+
size=rcParams['axes.labelsize'],
1556+
weight=rcParams['axes.labelweight']),
15561557
color = rcParams['axes.labelcolor'],
15571558
verticalalignment='top',
15581559
horizontalalignment='center',
@@ -1809,7 +1810,8 @@ def _get_label(self):
18091810
label = mtext.Text(x=0, y=0.5,
18101811
# todo: get the label position
18111812
fontproperties=font_manager.FontProperties(
1812-
size=rcParams['axes.labelsize']),
1813+
size=rcParams['axes.labelsize'],
1814+
weight=rcParams['axes.labelweight']),
18131815
color = rcParams['axes.labelcolor'],
18141816
verticalalignment='center',
18151817
horizontalalignment='right',

lib/matplotlib/rcsetup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ def __call__(self, s):
441441
'axes.titlesize' : ['large', validate_fontsize], # fontsize of the axes title
442442
'axes.grid' : [False, validate_bool], # display grid or not
443443
'axes.labelsize' : ['medium', validate_fontsize], # fontsize of the x any y labels
444+
'axes.labelweight' : ['normal', str], # fontsize of the x any y labels
444445
'axes.labelcolor' : ['k', validate_color], # color of axis label
445446
'axes.formatter.limits' : [[-7, 7], validate_nseq_int(2)],
446447
# use scientific notation if log10

lib/mpl_toolkits/axisartist/axis_artist.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,9 @@ def _init_label(self, **kw):
13811381
rcParams['axes.labelsize'])
13821382
#labelcolor = kw.get("labelcolor",
13831383
# rcParams['axes.labelcolor'])
1384-
fontprops = font_manager.FontProperties(size=labelsize)
1384+
fontprops = font_manager.FontProperties(
1385+
size=labelsize,
1386+
weight=rcParams['axes.labelweight'])
13851387
textprops = dict(fontproperties = fontprops)
13861388
#color = labelcolor)
13871389

@@ -1407,7 +1409,9 @@ def _update_label(self, renderer):
14071409
if not self.label.get_visible():
14081410
return
14091411

1410-
fontprops = font_manager.FontProperties(size=rcParams['axes.labelsize'])
1412+
fontprops = font_manager.FontProperties(
1413+
size=rcParams['axes.labelsize'],
1414+
weight=rcParams['axes.labelweight'])
14111415

14121416
#pad_points = self.major_tick_pad
14131417

@@ -1450,7 +1454,9 @@ def _draw_label2(self, renderer):
14501454
if not self.label.get_visible():
14511455
return
14521456

1453-
fontprops = font_manager.FontProperties(size=rcParams['axes.labelsize'])
1457+
fontprops = font_manager.FontProperties(
1458+
size=rcParams['axes.labelsize'],
1459+
weight=rcParams['axes.labelweight'])
14541460

14551461
#pad_points = self.major_tick_pad
14561462

matplotlibrc.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ backend : %(backend)s
194194
#axes.grid : False # display grid or not
195195
#axes.titlesize : large # fontsize of the axes title
196196
#axes.labelsize : medium # fontsize of the x any y labels
197+
#axes.labelweight : normal # weight of the x and y labels
197198
#axes.labelcolor : black
198199
#axes.axisbelow : False # whether axis gridlines and ticks are below
199200
# the axes elements (lines, text, etc)

0 commit comments

Comments
 (0)