From 0ebfc969dd07d2f6f7f3bfa5b3f18fec2e69da19 Mon Sep 17 00:00:00 2001 From: Gaute Hope Date: Thu, 24 Sep 2015 11:12:11 +0200 Subject: [PATCH 1/2] fix #4854: set default numpoints of legend entries to 1 --- lib/matplotlib/mpl-data/stylelib/classic.mplstyle | 2 +- lib/matplotlib/rcsetup.py | 2 +- matplotlibrc.template | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/mpl-data/stylelib/classic.mplstyle b/lib/matplotlib/mpl-data/stylelib/classic.mplstyle index 7660f8575e9c..3e7b36c9af2d 100644 --- a/lib/matplotlib/mpl-data/stylelib/classic.mplstyle +++ b/lib/matplotlib/mpl-data/stylelib/classic.mplstyle @@ -255,7 +255,7 @@ legend.fancybox : False # if True, use a rounded box for the # legend, else a rectangle legend.loc : upper right legend.isaxes : True # this option is internally ignored -legend.numpoints : 2 # the number of points in the legend line +legend.numpoints : 1 # the number of points in the legend line legend.fontsize : large legend.borderpad : 0.4 # border whitespace in fontsize units legend.markerscale : 1.0 # the relative size of legend markers vs. original diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 70c693563e64..843632d2e865 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -1005,7 +1005,7 @@ def validate_hist_bins(s): 'legend.isaxes': [True, validate_bool], # the number of points in the legend line - 'legend.numpoints': [2, validate_int], + 'legend.numpoints': [1, validate_int], # the number of points in the legend line for scatter 'legend.scatterpoints': [3, validate_int], 'legend.fontsize': ['large', validate_fontsize], diff --git a/matplotlibrc.template b/matplotlibrc.template index b4e602b846c5..67cbd5319627 100644 --- a/matplotlibrc.template +++ b/matplotlibrc.template @@ -364,7 +364,7 @@ backend : %(backend)s #legend.fancybox : False # if True, use a rounded box for the # legend, else a rectangle #legend.isaxes : True -#legend.numpoints : 2 # the number of points in the legend line +#legend.numpoints : 1 # the number of points in the legend line #legend.fontsize : large #legend.borderpad : 0.5 # border whitespace in fontsize units #legend.markerscale : 1.0 # the relative size of legend markers vs. original From a636f588ff7d0c14b63831d8c381fe5c4d18ea21 Mon Sep 17 00:00:00 2001 From: Gaute Hope Date: Thu, 24 Sep 2015 11:49:03 +0200 Subject: [PATCH 2/2] classic style should not be changed --- lib/matplotlib/mpl-data/stylelib/classic.mplstyle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/mpl-data/stylelib/classic.mplstyle b/lib/matplotlib/mpl-data/stylelib/classic.mplstyle index 3e7b36c9af2d..7660f8575e9c 100644 --- a/lib/matplotlib/mpl-data/stylelib/classic.mplstyle +++ b/lib/matplotlib/mpl-data/stylelib/classic.mplstyle @@ -255,7 +255,7 @@ legend.fancybox : False # if True, use a rounded box for the # legend, else a rectangle legend.loc : upper right legend.isaxes : True # this option is internally ignored -legend.numpoints : 1 # the number of points in the legend line +legend.numpoints : 2 # the number of points in the legend line legend.fontsize : large legend.borderpad : 0.4 # border whitespace in fontsize units legend.markerscale : 1.0 # the relative size of legend markers vs. original