From c2b288b13d8ee0ba3f6df01b888a248556f7281b Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 20 Aug 2012 17:54:24 +0100 Subject: [PATCH 1/2] Make grid accept alpha rcParam Default grid.alpha is 1.0 --- lib/matplotlib/axis.py | 2 ++ lib/matplotlib/rcsetup.py | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index 43db8b9b7f9f..3723845e7b5d 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -412,6 +412,7 @@ def _get_gridline(self): color=rcParams['grid.color'], linestyle=rcParams['grid.linestyle'], linewidth=rcParams['grid.linewidth'], + alpha=rcParams['grid.alpha'], ) l.set_transform(self.axes.get_xaxis_transform(which='grid')) l.get_path()._interpolation_steps = GRIDLINE_INTERPOLATION_STEPS @@ -550,6 +551,7 @@ def _get_gridline(self): color=rcParams['grid.color'], linestyle=rcParams['grid.linestyle'], linewidth=rcParams['grid.linewidth'], + alpha=rcParams['grid.alpha'], ) l.set_transform(self.axes.get_yaxis_transform(which='grid')) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 015945578cf6..e7fe4751f0c9 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -539,6 +539,7 @@ def __call__(self, s): 'grid.color' : ['k', validate_color], # grid color 'grid.linestyle' : [':', str], # dotted 'grid.linewidth' : [0.5, validate_float], # in points + 'grid.alpha' : [1.0, validate_float], # figure props From aa3c9a000e7f8a08fad48128eeb1e81365ad6d3b Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Tue, 21 Aug 2012 10:34:47 +0100 Subject: [PATCH 2/2] Update rc file to reflect grid alpha parameter --- matplotlibrc.template | 1 + 1 file changed, 1 insertion(+) diff --git a/matplotlibrc.template b/matplotlibrc.template index 86238c090173..5aa39074768e 100644 --- a/matplotlibrc.template +++ b/matplotlibrc.template @@ -271,6 +271,7 @@ text.hinting_factor : 8 # Specifies the amount of softness for hinting in the #grid.color : black # grid color #grid.linestyle : : # dotted #grid.linewidth : 0.5 # in points +#grid.alpha : 1.0 # transparency, between 0.0 and 1.0 ### Legend #legend.fancybox : False # if True, use a rounded box for the