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

Skip to content

Commit 06135c9

Browse files
committed
Legend default style change: smaller, no border
Addresses #5269
1 parent e785afb commit 06135c9

File tree

3 files changed

+22
-26
lines changed

3 files changed

+22
-26
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ grid.alpha : 1.0 # transparency, between 0.0 and 1.0
267267
legend.fancybox : False # if True, use a rounded box for the
268268
# legend, else a rectangle
269269
legend.loc : upper right
270-
legend.isaxes : True # this option is internally ignored
271270
legend.numpoints : 2 # the number of points in the legend line
272271
legend.fontsize : large
273272
legend.borderpad : 0.4 # border whitespace in fontsize units
@@ -503,4 +502,4 @@ animation.convert_path: convert # Path to ImageMagick's convert binary.
503502
animation.convert_args:
504503
animation.html: none
505504

506-
_internal.classic_mode: True
505+
_internal.classic_mode: True

lib/matplotlib/rcsetup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,8 +1101,6 @@ def validate_hist_bins(s):
11011101

11021102
#legend properties
11031103
'legend.fancybox': [True, validate_bool],
1104-
1105-
# at some point, legend.loc should be changed to 'best'
11061104
'legend.loc': ['best', validate_legend_loc],
11071105

11081106
# this option is internally ignored - it never served any useful purpose
@@ -1112,12 +1110,12 @@ def validate_hist_bins(s):
11121110
'legend.numpoints': [1, validate_int],
11131111
# the number of points in the legend line for scatter
11141112
'legend.scatterpoints': [3, validate_int],
1115-
'legend.fontsize': ['large', validate_fontsize],
1113+
'legend.fontsize': ['small', validate_fontsize],
11161114
# the relative size of legend markers vs. original
11171115
'legend.markerscale': [1.0, validate_float],
11181116
'legend.shadow': [False, validate_bool],
11191117
# whether or not to draw a frame around legend
1120-
'legend.frameon': [True, validate_bool],
1118+
'legend.frameon': [False, validate_bool],
11211119
# alpha value of the legend frame
11221120
'legend.framealpha': [None, validate_float_or_None],
11231121

matplotlibrc.template

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -387,33 +387,32 @@ backend : $TEMPLATE_BACKEND
387387

388388

389389
### GRIDS
390-
#grid.color : b0b0b0 # grid color
390+
#grid.color : b0b0b0 # grid color
391391
#grid.linestyle : - # solid
392392
#grid.linewidth : 1.0 # in points
393393
#grid.alpha : 1.0 # transparency, between 0.0 and 1.0
394394

395395
### Legend
396-
#legend.fancybox : True # if True, use a rounded box for the
397-
# legend, else a rectangle
398396
#legend.loc : best
399-
#legend.isaxes : True
400-
#legend.numpoints : 1 # the number of points in the legend line
401-
#legend.fontsize : large
402-
#legend.borderpad : 0.5 # border whitespace in fontsize units
403-
#legend.markerscale : 1.0 # the relative size of legend markers vs. original
404-
# the following dimensions are in axes coords
405-
#legend.labelspacing : 0.5 # the vertical space between the legend entries in fraction of fontsize
406-
#legend.handlelength : 2. # the length of the legend lines in fraction of fontsize
407-
#legend.handleheight : 0.7 # the height of the legend handle in fraction of fontsize
408-
#legend.handletextpad : 0.8 # the space between the legend line and legend text in fraction of fontsize
409-
#legend.borderaxespad : 0.5 # the border between the axes and legend edge in fraction of fontsize
410-
#legend.columnspacing : 2. # the border between the axes and legend edge in fraction of fontsize
411-
#legend.shadow : False
412-
#legend.frameon : True # whether or not to draw a frame around legend
413-
#legend.framealpha : None # opacity of of legend frame
414-
#legend.scatterpoints : 3 # number of scatter points
415-
#legend.facecolor : inherit
397+
#legend.frameon : False # whether or not to draw a frame around legend
398+
#legend.framealpha : None # legend frame transparency
399+
#legend.facecolor : inherit # inherit from axes.facecolor; or color spec
416400
#legend.edgecolor : k
401+
#legend.fancybox : True # if True, use a rounded box for the
402+
# legend, else a rectangle
403+
#legend.shadow : False
404+
#legend.numpoints : 1 # the number of marker points in the legend line
405+
#legend.scatterpoints : 3 # number of scatter points
406+
#legend.markerscale : 1.0 # the relative size of legend markers vs. original
407+
#legend.fontsize : small
408+
# Dimensions as fraction of fontsize:
409+
#legend.borderpad : 0.4 # border whitespace
410+
#legend.labelspacing : 0.5 # the vertical space between the legend entries
411+
#legend.handlelength : 2.0 # the length of the legend lines
412+
#legend.handleheight : 0.7 # the height of the legend handle
413+
#legend.handletextpad : 0.8 # the space between the legend line and legend text
414+
#legend.borderaxespad : 0.5 # the border between the axes and legend edge
415+
#legend.columnspacing : 2.0 # column separation
417416

418417
### FIGURE
419418
# See http://matplotlib.org/api/figure_api.html#matplotlib.figure.Figure

0 commit comments

Comments
 (0)