Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 545044a

Browse files
committed
Merge branch 'grid_indep_axis_ctrl' of http://github.com/kaufman/matplotlib
2 parents ef87548 + 924393f commit 545044a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/matplotlib/axes.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2036,11 +2036,11 @@ def set_axisbelow(self, b):
20362036
self._axisbelow = b
20372037

20382038
@docstring.dedent_interpd
2039-
def grid(self, b=None, which='major', axis='xy', **kwargs):
2039+
def grid(self, b=None, which='major', axis='both', **kwargs):
20402040
"""
20412041
call signature::
20422042
2043-
grid(self, b=None, which='major', axis='xy', **kwargs)
2043+
grid(self, b=None, which='major', axis='both', **kwargs)
20442044
20452045
Set the axes grids on or off; *b* is a boolean. (For MATLAB
20462046
compatibility, *b* may also be a string, 'on' or 'off'.)
@@ -2052,7 +2052,7 @@ def grid(self, b=None, which='major', axis='xy', **kwargs):
20522052
*which* can be 'major' (default), 'minor', or 'both' to control
20532053
whether major tick grids, minor tick grids, or both are affected.
20542054
2055-
*axis* can be 'xy' (default), 'x', or 'y' to control which
2055+
*axis* can be 'both' (default), 'x', or 'y' to control which
20562056
set of gridlines are drawn.
20572057
20582058
*kawrgs* are used to set the grid line properties, eg::
@@ -2068,9 +2068,9 @@ def grid(self, b=None, which='major', axis='xy', **kwargs):
20682068
b = True
20692069
b = _string_to_bool(b)
20702070

2071-
if axis == 'x' or axis == 'xy':
2071+
if axis == 'x' or axis == 'both':
20722072
self.xaxis.grid(b, which=which, **kwargs)
2073-
if axis == 'y' or axis == 'xy':
2073+
if axis == 'y' or axis == 'both':
20742074
self.yaxis.grid(b, which=which, **kwargs)
20752075

20762076
def ticklabel_format(self, **kwargs):

lib/matplotlib/pyplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2644,7 +2644,7 @@ def cla():
26442644
# This function was autogenerated by boilerplate.py. Do not edit as
26452645
# changes will be lost
26462646
@docstring.copy_dedent(Axes.grid)
2647-
def grid(b=None, which='major', axis='xy', **kwargs):
2647+
def grid(b=None, which='major', axis='both', **kwargs):
26482648
ret = gca().grid(b, which, axis, **kwargs)
26492649
draw_if_interactive()
26502650
return ret

0 commit comments

Comments
 (0)