New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix rc grid parameter inconsistency #2110
Conversation
elif (not major) and (rcParams['axes.grid.which'] in ('both','minor')): | ||
gridOn = rcParams['axes.grid'] | ||
else : | ||
gridOn = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feel strange to read rcParams here in Ticks
if it is called axes
, and is already used in axes.py
. Moreover, the value of gridOn
seem to be passed around here and commenting all this block does indead keep the wanted behavior. I propose to change those rcparams to <x|y>tick.<major|minor>.grid = Bool
to be consistent with the all the other parameters.... unless I'm missing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it would be nice to rename the rcparams, but for backward compatibility I'm not sure we can.
I also added test, not sure if they are correctly written though. |
I'll still be happy to get comment on the previous question,
I can also rebase to merge commit together, or shuffle them around to have test-commit before the rest. You might want me to add a line in the change log for the new rc-param ? |
@@ -578,6 +580,10 @@ def __call__(self, s): | |||
'axes.titlesize': ['large', validate_fontsize], # fontsize of the | |||
# axes title | |||
'axes.grid': [False, validate_bool], # display grid or not | |||
'axes.grid.which': ['major', validate_axis_locator],# set wether the gid are by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We follow pep8 convention: please add two spaces before the comment.
This looks good to me. 👍 for merge |
@Carreau: Would you mind rebasing this so we can hit the big green merge button? |
Yes, I will, I saw that it was conflicting. IPython 1.0.alpha first :-) |
Sorry for the time to rebase. Done now. I can't seem to install this dev version of matplotlib on the current machine I am on, so can't run tests, but will try to do tomorrow. |
@@ -1664,6 +1664,28 @@ def make_patch_spines_invisible(ax): | |||
host.tick_params(axis='x', **tkw) | |||
|
|||
|
|||
def test_rcparam_grid_minor(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a @cleanup
decorator to this function, please?
Sure, |
Fix rc grid parameter inconsistency
Hm. I wrote a small wrapper around |
@burnpanck You should follow the discussion of moving |
Is that on the ML or on one of the issues ( my github issue foo only showed 2 issues not really active) ? |
Mostly on the mailing list, @ellisonbg is involved. |
Ok, I think I found it, its the one about SciPy Sprint. Brian is not alway reliable to let the rest of the team know about things like that. I think he is often using the Royal "We" (that part of your charm @ellisonbg). I was not on the dev ML, so I cannot "respond" to the thread, but once I can, I'll share a link to my previous work on that. |
I have linked to your previous work a couple of times already. On Fri, Jun 26, 2015 at 10:45 AM Matthias Bussonnier <
|
Ok. I'll try to attend the BoF too, if no conflicts. |
Traitlets based attributes, that's great! I'm not really actively monitoring matplotlib's development (except for reading the release notes, whenever there are), just wanted to point out that this parameter naming could conflict with exactly such concepts. Anyhow, I'm looking forward to this! |
This is a first attempt at fixing #2109.
It introduces a condition in
/lib/matplotlib/axis.py:Ticks
that setgridOn
to the rcparam only ifTick
ismajor
, and add an rcparamaxes.grid.which
.I have a few question that I'll add directly on the relevant line in the
File Changed
tab.