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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1664,6 +1664,29 @@ def make_patch_spines_invisible(ax): | |
host.tick_params(axis='x', **tkw) | ||
|
||
|
||
@cleanup | ||
def test_rcparam_grid_minor(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a |
||
orig_grid = matplotlib.rcParams['axes.grid'] | ||
orig_locator = matplotlib.rcParams['axes.grid.which'] | ||
|
||
matplotlib.rcParams['axes.grid'] = True | ||
|
||
values = ( | ||
(('both'), (True, True)), | ||
(('major'), (True, False)), | ||
(('minor'), (False, True)) | ||
) | ||
|
||
for locator, result in values: | ||
matplotlib.rcParams['axes.grid.which'] = locator | ||
fig = plt.figure() | ||
ax = fig.add_subplot(1, 1, 1) | ||
assert((ax.xaxis._gridOnMajor, ax.xaxis._gridOnMinor) == result) | ||
|
||
matplotlib.rcParams['axes.grid'] = orig_grid | ||
matplotlib.rcParams['axes.grid.which'] = orig_locator | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PEP8 convention: two lines (and only two) between functions. You can install the flake8 plugin in vim so that it tells you straight away if your code is pep8 or not. |
||
@cleanup | ||
def test_vline_limit(): | ||
fig = plt.figure() | ||
|
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.
PEP8 convention: there should be two lines between functions.