Skip to content

Commit 344ed6b

Browse files
committed
Fix deprecation of Tick.apply_tickdir.
1 parent c64e8bb commit 344ed6b

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

lib/matplotlib/axis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def _apply_tickdir(self, tickdir):
211211

212212
@_api.deprecated("3.5", alternative="axis.set_tick_params")
213213
def apply_tickdir(self, tickdir):
214-
self._apply_tickdir()
214+
self._apply_tickdir(tickdir)
215215
self.stale = True
216216

217217
def get_tickdir(self):

lib/matplotlib/tests/test_axes.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5789,6 +5789,24 @@ def test_pandas_bar_align_center(pd):
57895789
fig.canvas.draw()
57905790

57915791

5792+
def test_tick_apply_tickdir_deprecation():
5793+
# Remove this test when the deprecation expires.
5794+
import matplotlib.axis as maxis
5795+
ax = plt.axes()
5796+
5797+
tick = maxis.XTick(ax, 0)
5798+
with pytest.warns(MatplotlibDeprecationWarning,
5799+
match="The apply_tickdir function was deprecated in "
5800+
"Matplotlib 3.5"):
5801+
tick.apply_tickdir('out')
5802+
5803+
tick = maxis.YTick(ax, 0)
5804+
with pytest.warns(MatplotlibDeprecationWarning,
5805+
match="The apply_tickdir function was deprecated in "
5806+
"Matplotlib 3.5"):
5807+
tick.apply_tickdir('out')
5808+
5809+
57925810
def test_axis_set_tick_params_labelsize_labelcolor():
57935811
# Tests fix for issue 4346
57945812
axis_1 = plt.subplot()

0 commit comments

Comments
 (0)