Skip to content

Loading…

Make grid accept alpha rcParam #1114

Merged
merged 2 commits into from

3 participants

@dmcdougall
Matplotlib Developers member

This PR fixes #871

I should probably update the docstrings, too. And the default matplotlibrc file.

@dmcdougall
Matplotlib Developers member

Actually, the docstrings for axes, etc don't need updated. They already accepted the alpha kwarg. I should update the default matplotlibrc file, though.

$ find . -iname '*rc'
./doc/matplotlibrc
./doc/pyplots/matplotlibrc
./lib/matplotlib/mpl-data/matplotlibrc
./lib/matplotlib/tests/test_rcparams.rc

Which one of these do I need to update?

@pelson
Matplotlib Developers member

Without any authority on the matter, I would say:

matplotlibrc.template
./lib/matplotlib/mpl-data/matplotlibrc
./doc/pyplots/matplotlibrc

While digging, I found lib/matplotlib/mpl-data/matplotlib.conf, can anyone tell me if this is still used?

Clearly this is highlighting an issue.

@pelson
Matplotlib Developers member

I've made an issue for discussion on the various rc files and the conf file to keep the conversations separate from this PR.

@dmcdougall
Matplotlib Developers member

That's a great idea. Thanks.

I also found lib/matplotlib/mpl-data/matplotlib.conf.template too.

@dmcdougall
Matplotlib Developers member

Wait a sec, I found this in the .gitignore file:

# Things specific to this project #
###################################
lib/matplotlib/mpl-data/matplotlib.conf
lib/matplotlib/mpl-data/matplotlibrc
@mdboom
Matplotlib Developers member

matplotlibrc.template is the one to update.

@dmcdougall
Matplotlib Developers member

Right, I will remove the update to the one under the docs directory. Thank you.

@pelson
Matplotlib Developers member

Looks fine to me. +1

@mdboom mdboom merged commit b0393e9 into matplotlib:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 21, 2012
  1. @dmcdougall

    Make grid accept alpha rcParam

    dmcdougall committed
    Default grid.alpha is 1.0
  2. @dmcdougall
Showing with 4 additions and 0 deletions.
  1. +2 −0 lib/matplotlib/axis.py
  2. +1 −0 lib/matplotlib/rcsetup.py
  3. +1 −0 matplotlibrc.template
View
2 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'))
View
1 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
View
1 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
Something went wrong with that request. Please try again.