Skip to content

Commit 314785e

Browse files
committed
Fix test
1 parent a787f98 commit 314785e

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

lib/matplotlib/axis.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,12 @@ def __init__(
145145
zorder = mlines.Line2D.zorder
146146
self._zorder = zorder
147147

148-
grid_color = mpl._val_or_rc(grid_color, "grid.color")
149-
grid_linestyle = mpl._val_or_rc(grid_linestyle, "grid.linestyle")
150-
grid_linewidth = mpl._val_or_rc(grid_linewidth, "grid.linewidth")
148+
if grid_color is None:
149+
grid_color = mpl.rcParams["grid.color"]
150+
if grid_linestyle is None:
151+
grid_linestyle = mpl.rcParams["grid.linestyle"]
152+
if grid_linewidth is None:
153+
grid_linewidth = mpl.rcParams["grid.linewidth"]
151154
if grid_alpha is None and not mcolors._has_alpha_channel(grid_color):
152155
# alpha precedence: kwarg > color alpha > rcParams['grid.alpha']
153156
# Note: only resolve to rcParams if the color does not have alpha
@@ -772,7 +775,6 @@ def set_label_coords(self, x, y, transform=None):
772775
self.stale = True
773776

774777
def get_transform(self):
775-
"""Return the transform used in the Axis' scale"""
776778
return self._scale.get_transform()
777779

778780
def get_scale(self):
@@ -1239,13 +1241,11 @@ def _set_lim(self, v0, v1, *, emit=True, auto):
12391241
self.axes.callbacks.process(f"{name}lim_changed", self.axes)
12401242
# Call all of the other axes that are shared with this one
12411243
for other in self._get_shared_axes():
1242-
if other is self.axes:
1243-
continue
1244-
other._axis_map[name]._set_lim(v0, v1, emit=False, auto=auto)
1245-
if emit:
1246-
other.callbacks.process(f"{name}lim_changed", other)
1247-
if other.figure != self.figure:
1248-
other.figure.canvas.draw_idle()
1244+
if other is not self.axes:
1245+
other._axis_map[name]._set_lim(
1246+
v0, v1, emit=False, auto=auto)
1247+
if other.figure != self.figure:
1248+
other.figure.canvas.draw_idle()
12491249

12501250
self.stale = True
12511251
return v0, v1
@@ -1966,6 +1966,7 @@ def set_ticklabels(self, labels, *, minor=False, fontdict=None, **kwargs):
19661966
raise TypeError(f"{labels:=} must be a sequence") from None
19671967
locator = (self.get_minor_locator() if minor
19681968
else self.get_major_locator())
1969+
19691970
if not labels:
19701971
# eg labels=[]:
19711972
formatter = mticker.NullFormatter()

0 commit comments

Comments
 (0)