FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

change 'xy' axis option to 'both' to maintain consistency with other functions. by kaufman · Pull Request #90 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
10 changes: 5 additions & 5 deletions lib/matplotlib/axes.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2036,11 +2036,11 @@ def set_axisbelow(self, b):
self._axisbelow = b

@docstring.dedent_interpd
def grid(self, b=None, which='major', axis='xy', **kwargs):
def grid(self, b=None, which='major', axis='both', **kwargs):
"""
call signature::

grid(self, b=None, which='major', axis='xy', **kwargs)
grid(self, b=None, which='major', axis='both', **kwargs)

Set the axes grids on or off; *b* is a boolean. (For MATLAB
compatibility, *b* may also be a string, 'on' or 'off'.)
Expand All @@ -2052,7 +2052,7 @@ def grid(self, b=None, which='major', axis='xy', **kwargs):
*which* can be 'major' (default), 'minor', or 'both' to control
whether major tick grids, minor tick grids, or both are affected.

*axis* can be 'xy' (default), 'x', or 'y' to control which
*axis* can be 'both' (default), 'x', or 'y' to control which
set of gridlines are drawn.

*kawrgs* are used to set the grid line properties, eg::
Expand All @@ -2068,9 +2068,9 @@ def grid(self, b=None, which='major', axis='xy', **kwargs):
b = True
b = _string_to_bool(b)

if axis == 'x' or axis == 'xy':
if axis == 'x' or axis == 'both':
self.xaxis.grid(b, which=which, **kwargs)
if axis == 'y' or axis == 'xy':
if axis == 'y' or axis == 'both':
self.yaxis.grid(b, which=which, **kwargs)

def ticklabel_format(self, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/pyplot.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2644,7 +2644,7 @@ def cla():
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
@docstring.copy_dedent(Axes.grid)
def grid(b=None, which='major', axis='xy', **kwargs):
def grid(b=None, which='major', axis='both', **kwargs):
ret = gca().grid(b, which, axis, **kwargs)
draw_if_interactive()
return ret
Expand Down

Back | FazBrowse Home | New Git URL