Skip to content

Commit b0393e9

Browse files
committed
Merge pull request #1114 from dmcdougall/alpha
Make grid accept alpha rcParam
2 parents c981774 + aa3c9a0 commit b0393e9

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

lib/matplotlib/axis.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ def _get_gridline(self):
412412
color=rcParams['grid.color'],
413413
linestyle=rcParams['grid.linestyle'],
414414
linewidth=rcParams['grid.linewidth'],
415+
alpha=rcParams['grid.alpha'],
415416
)
416417
l.set_transform(self.axes.get_xaxis_transform(which='grid'))
417418
l.get_path()._interpolation_steps = GRIDLINE_INTERPOLATION_STEPS
@@ -550,6 +551,7 @@ def _get_gridline(self):
550551
color=rcParams['grid.color'],
551552
linestyle=rcParams['grid.linestyle'],
552553
linewidth=rcParams['grid.linewidth'],
554+
alpha=rcParams['grid.alpha'],
553555
)
554556

555557
l.set_transform(self.axes.get_yaxis_transform(which='grid'))

lib/matplotlib/rcsetup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ def __call__(self, s):
539539
'grid.color' : ['k', validate_color], # grid color
540540
'grid.linestyle' : [':', str], # dotted
541541
'grid.linewidth' : [0.5, validate_float], # in points
542+
'grid.alpha' : [1.0, validate_float],
542543

543544

544545
# figure props

matplotlibrc.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ text.hinting_factor : 8 # Specifies the amount of softness for hinting in the
271271
#grid.color : black # grid color
272272
#grid.linestyle : : # dotted
273273
#grid.linewidth : 0.5 # in points
274+
#grid.alpha : 1.0 # transparency, between 0.0 and 1.0
274275

275276
### Legend
276277
#legend.fancybox : False # if True, use a rounded box for the

0 commit comments

Comments
 (0)