Skip to content

Commit 76522fa

Browse files
authored
Merge pull request matplotlib#20438 from QuLogic/fix-tickdir-deprecation
Fix deprecation of `Tick.apply_tickdir`.
2 parents 294bd07 + 344ed6b commit 76522fa

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
@@ -5771,6 +5771,24 @@ def test_pandas_bar_align_center(pd):
57715771
fig.canvas.draw()
57725772

57735773

5774+
def test_tick_apply_tickdir_deprecation():
5775+
# Remove this test when the deprecation expires.
5776+
import matplotlib.axis as maxis
5777+
ax = plt.axes()
5778+
5779+
tick = maxis.XTick(ax, 0)
5780+
with pytest.warns(MatplotlibDeprecationWarning,
5781+
match="The apply_tickdir function was deprecated in "
5782+
"Matplotlib 3.5"):
5783+
tick.apply_tickdir('out')
5784+
5785+
tick = maxis.YTick(ax, 0)
5786+
with pytest.warns(MatplotlibDeprecationWarning,
5787+
match="The apply_tickdir function was deprecated in "
5788+
"Matplotlib 3.5"):
5789+
tick.apply_tickdir('out')
5790+
5791+
57745792
def test_axis_set_tick_params_labelsize_labelcolor():
57755793
# Tests fix for issue 4346
57765794
axis_1 = plt.subplot()

0 commit comments

Comments
 (0)