From 48910ca8c0bf5e9d84778536cbd7d737848d3b99 Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sat, 20 Aug 2022 19:20:01 -0400 Subject: [PATCH 01/12] Add get_tick_params(). --- lib/matplotlib/axes/_base.py | 17 +++++++++++++++++ lib/matplotlib/axis.py | 12 ++++++++++++ 2 files changed, 29 insertions(+) diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index 7e6f1ab3e6c2..8bd9fe4f8fd7 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -3400,6 +3400,23 @@ def tick_params(self, axis='both', **kwargs): ykw.pop('labelbottom', None) self.yaxis.set_tick_params(**ykw) + def get_tick_params(self, axis, which='major'): + """ + Get the appearance of ticks, tick labels, and gridlines. + + Parameters + ---------- + axis : {'x', 'y'} + The axis to which the parameters are applied. + which : {'major', 'minor'}, default: 'major' + The group of ticks to which the parameters are applied. + + """ + _api.check_in_list(['x', 'y'], axis=axis) + if axis == 'x': + return self.xaxis.get_tick_params(which=which) + return self.yaxis.get_tick_params(which=which) + def set_axis_off(self): """ Turn the x- and y-axis off. diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index 128714d5f42f..364122944703 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -973,6 +973,18 @@ def set_tick_params(self, which='major', reset=False, **kwargs): self.stale = True + def get_tick_params(self, which='major'): + """ + Get appearance parameters for ticks, ticklabels, and gridlines. + + For documentation of keyword arguments, see + :meth:`matplotlib.axes.Axes.get_tick_params`. + """ + _api.check_in_list(['major', 'minor'], which=which) + if which == 'major': + return self._major_tick_kw + return self._minor_tick_kw + @staticmethod def _translate_tick_params(kw): """ From 249f2ca2a9e15061e4c2684e546d722581f67a14 Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Mon, 5 Sep 2022 18:16:11 -0400 Subject: [PATCH 02/12] Update docstrings; add test case. --- lib/matplotlib/axes/_base.py | 20 ++------------------ lib/matplotlib/axis.py | 20 ++++++++++++++++++-- lib/matplotlib/tests/test_axes.py | 18 ++++++++++++++++++ 3 files changed, 38 insertions(+), 20 deletions(-) diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index 8bd9fe4f8fd7..57b2b36de83d 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -3326,7 +3326,8 @@ def tick_params(self, axis='both', **kwargs): Change the appearance of ticks, tick labels, and gridlines. Tick properties that are not explicitly set using the keyword - arguments remain unchanged unless *reset* is True. + arguments remain unchanged unless *reset* is True. For the current + style defaults, see :meth:`matplotlib.axis.Axis.get_tick_params`. Parameters ---------- @@ -3400,23 +3401,6 @@ def tick_params(self, axis='both', **kwargs): ykw.pop('labelbottom', None) self.yaxis.set_tick_params(**ykw) - def get_tick_params(self, axis, which='major'): - """ - Get the appearance of ticks, tick labels, and gridlines. - - Parameters - ---------- - axis : {'x', 'y'} - The axis to which the parameters are applied. - which : {'major', 'minor'}, default: 'major' - The group of ticks to which the parameters are applied. - - """ - _api.check_in_list(['x', 'y'], axis=axis) - if axis == 'x': - return self.xaxis.get_tick_params(which=which) - return self.yaxis.get_tick_params(which=which) - def set_axis_off(self): """ Turn the x- and y-axis off. diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index 364122944703..96a543e43d86 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -940,6 +940,12 @@ def set_tick_params(self, which='major', reset=False, **kwargs): For documentation of keyword arguments, see :meth:`matplotlib.axes.Axes.tick_params`. + + See Also + -------- + :meth:`.Axis.get_tick_params` + View the current style defaults for ticks, ticklabels, and + gridlines. """ _api.check_in_list(['major', 'minor', 'both'], which=which) kwtrans = self._translate_tick_params(kwargs) @@ -977,8 +983,18 @@ def get_tick_params(self, which='major'): """ Get appearance parameters for ticks, ticklabels, and gridlines. - For documentation of keyword arguments, see - :meth:`matplotlib.axes.Axes.get_tick_params`. + Parameters + ---------- + which : {'major', 'minor'}, default: 'major' + The group of ticks to which the parameters are applied. + + Notes + ----- + This method returns the default values for styling *new* elements + added to this axis and may be different from the values on current + elements, if they were modified directly by the user (e.g., via + ``set_*`` methods on individual tick objects). + """ _api.check_in_list(['major', 'minor'], which=which) if which == 'major': diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 268eb957f470..ac2cfaee400a 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -6377,6 +6377,24 @@ def test_tick_apply_tickdir_deprecation(): tick.apply_tickdir('out') +def test_axis_get_tick_params(): + axis = plt.subplot().yaxis + initial_major_style = {**axis.get_tick_params(which='major')} + initial_minor_style = {**axis.get_tick_params(which='minor')} + + assert axis._major_tick_kw == initial_major_style + assert axis._minor_tick_kw == initial_minor_style + axis.set_tick_params(labelsize=30, labelcolor='red', + direction='out', which='both') + + new_major_style = {**axis.get_tick_params(which='major')} + new_minor_style = {**axis.get_tick_params(which='minor')} + assert initial_major_style != new_major_style + assert axis._major_tick_kw == new_major_style + assert initial_minor_style != new_minor_style + assert axis._minor_tick_kw == new_minor_style + + def test_axis_set_tick_params_labelsize_labelcolor(): # Tests fix for issue 4346 axis_1 = plt.subplot() From 6c88dd95935bcc5125ebaa81cd8202c347f3941c Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sat, 22 Oct 2022 16:04:26 -0400 Subject: [PATCH 03/12] Add translation from internal kw to ones in tick_params() --- lib/matplotlib/axes/_base.py | 2 +- lib/matplotlib/axis.py | 41 ++++++++++++++++++++++--------- lib/matplotlib/tests/test_axes.py | 25 +++++++++++++------ 3 files changed, 47 insertions(+), 21 deletions(-) diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index 57b2b36de83d..178b57a9fdc2 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -3327,7 +3327,7 @@ def tick_params(self, axis='both', **kwargs): Tick properties that are not explicitly set using the keyword arguments remain unchanged unless *reset* is True. For the current - style defaults, see :meth:`matplotlib.axis.Axis.get_tick_params`. + style defaults, see `.Axis.get_tick_params`. Parameters ---------- diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index 96a543e43d86..3055989a1988 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -943,7 +943,7 @@ def set_tick_params(self, which='major', reset=False, **kwargs): See Also -------- - :meth:`.Axis.get_tick_params` + .Axis.get_tick_params View the current style defaults for ticks, ticklabels, and gridlines. """ @@ -988,6 +988,10 @@ def get_tick_params(self, which='major'): which : {'major', 'minor'}, default: 'major' The group of ticks to which the parameters are applied. + Returns + ------- + dict on properties that deviate from the default + Notes ----- This method returns the default values for styling *new* elements @@ -998,11 +1002,13 @@ def get_tick_params(self, which='major'): """ _api.check_in_list(['major', 'minor'], which=which) if which == 'major': - return self._major_tick_kw - return self._minor_tick_kw + return self._translate_tick_params( + self._major_tick_kw, reverse=True + ) + return self._translate_tick_params(self._minor_tick_kw, reverse=True) @staticmethod - def _translate_tick_params(kw): + def _translate_tick_params(kw, reverse=False): """ Translate the kwargs supported by `.Axis.set_tick_params` to kwargs supported by `.Tick._apply_params`. @@ -1013,9 +1019,12 @@ def _translate_tick_params(kw): Returns a new dict of translated kwargs. - Note: The input *kwargs* are currently modified, but that's ok for - the only caller. + Note: Use reverse=True to translate from those supported by + `.Tick._apply_params` back to those supported by + `.Axis.set_tick_params`. """ + kw_ = {**kw} + # The following lists may be moved to a more accessible location. allowed_keys = [ 'size', 'width', 'color', 'tickdir', 'pad', @@ -1040,19 +1049,27 @@ def _translate_tick_params(kw): 'labelright': 'label2On', 'labeltop': 'label2On', } - kwtrans = {newkey: kw.pop(oldkey) - for oldkey, newkey in keymap.items() if oldkey in kw} - if 'colors' in kw: - c = kw.pop('colors') + if reverse: + kwtrans = { + oldkey: kw_.pop(newkey) + for oldkey, newkey in keymap.items() if newkey in kw_ + } + else: + kwtrans = { + newkey: kw_.pop(oldkey) + for oldkey, newkey in keymap.items() if oldkey in kw_ + } + if 'colors' in kw_: + c = kw_.pop('colors') kwtrans['color'] = c kwtrans['labelcolor'] = c # Maybe move the checking up to the caller of this method. - for key in kw: + for key in kw_: if key not in allowed_keys: raise ValueError( "keyword %s is not recognized; valid keywords are %s" % (key, allowed_keys)) - kwtrans.update(kw) + kwtrans.update(kw_) return kwtrans def set_clip_path(self, clippath, transform=None): diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index ac2cfaee400a..5f4ecc1403eb 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -6379,19 +6379,28 @@ def test_tick_apply_tickdir_deprecation(): def test_axis_get_tick_params(): axis = plt.subplot().yaxis - initial_major_style = {**axis.get_tick_params(which='major')} - initial_minor_style = {**axis.get_tick_params(which='minor')} + initial_major_style_translated = {**axis.get_tick_params(which='major')} + initial_minor_style_translated = {**axis.get_tick_params(which='minor')} - assert axis._major_tick_kw == initial_major_style - assert axis._minor_tick_kw == initial_minor_style + translated_major_kw = axis._translate_tick_params( + axis._major_tick_kw, reverse=True + ) + translated_minor_kw = axis._translate_tick_params( + axis._minor_tick_kw, reverse=True + ) + + assert translated_major_kw == initial_major_style_translated + assert translated_minor_kw == initial_minor_style_translated axis.set_tick_params(labelsize=30, labelcolor='red', direction='out', which='both') - new_major_style = {**axis.get_tick_params(which='major')} - new_minor_style = {**axis.get_tick_params(which='minor')} - assert initial_major_style != new_major_style + new_major_style_translated = {**axis.get_tick_params(which='major')} + new_minor_style_translated = {**axis.get_tick_params(which='minor')} + new_major_style = axis._translate_tick_params(new_major_style_translated) + new_minor_style = axis._translate_tick_params(new_minor_style_translated) + assert initial_major_style_translated != new_major_style_translated assert axis._major_tick_kw == new_major_style - assert initial_minor_style != new_minor_style + assert initial_minor_style_translated != new_minor_style_translated assert axis._minor_tick_kw == new_minor_style From 51109334c1ad68d4cb4580ed0b82c84540a0fba3 Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sat, 5 Nov 2022 11:14:44 -0700 Subject: [PATCH 04/12] Resolve merge conflict. --- lib/matplotlib/tests/test_axes.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 3228597c4861..aed45743d66b 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -6452,24 +6452,6 @@ def test_pandas_bar_align_center(pd): fig.canvas.draw() -def test_tick_apply_tickdir_deprecation(): - # Remove this test when the deprecation expires. - import matplotlib.axis as maxis - ax = plt.axes() - - tick = maxis.XTick(ax, 0) - with pytest.warns(MatplotlibDeprecationWarning, - match="The apply_tickdir function was deprecated in " - "Matplotlib 3.5"): - tick.apply_tickdir('out') - - tick = maxis.YTick(ax, 0) - with pytest.warns(MatplotlibDeprecationWarning, - match="The apply_tickdir function was deprecated in " - "Matplotlib 3.5"): - tick.apply_tickdir('out') - - def test_axis_get_tick_params(): axis = plt.subplot().yaxis initial_major_style_translated = {**axis.get_tick_params(which='major')} From c3c441ddea34113c0352b040c700fc5b597465a2 Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sat, 5 Nov 2022 20:29:23 -0400 Subject: [PATCH 05/12] Add example to docstring; tweak returns and parameter sections. --- lib/matplotlib/axis.py | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index 745d55a83b3b..1e1a3ab900c8 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -962,11 +962,12 @@ def get_tick_params(self, which='major'): Parameters ---------- which : {'major', 'minor'}, default: 'major' - The group of ticks to which the parameters are applied. + The group of ticks for which the parameters are retrieved. Returns ------- - dict on properties that deviate from the default + dict + Default properties for styling *new* elements added to this axis. Notes ----- @@ -975,6 +976,31 @@ def get_tick_params(self, which='major'): elements, if they were modified directly by the user (e.g., via ``set_*`` methods on individual tick objects). + Examples + -------- + :: + + >>> ax.yaxis.set_tick_params(labelsize=30, labelcolor='red', + direction='out', which='major') + >>> ax.yaxis.get_tick_params(which='major') + {'direction': 'out', + 'left': True, + 'right': False, + 'labelleft': True, + 'labelright': False, + 'gridOn': False, + 'labelsize': 30, + 'labelcolor': 'red'} + >>> ax.yaxis.get_tick_params(which='minor') + {'left': True, + 'right': False, + 'labelleft': True, + 'labelright': False, + 'gridOn': False} + + This allows us to confirm without visual inspection of the plot + that our styling is having the desired effect. + """ _api.check_in_list(['major', 'minor'], which=which) if which == 'major': From 6733c616a6cbab533e8c53f41db6d57d5b6969fc Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sat, 5 Nov 2022 20:42:49 -0400 Subject: [PATCH 06/12] Add get_tick_params to doc/api/axis_api.rst --- doc/api/axis_api.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/api/axis_api.rst b/doc/api/axis_api.rst index d950d1e253a4..e7da26a11706 100644 --- a/doc/api/axis_api.rst +++ b/doc/api/axis_api.rst @@ -100,6 +100,7 @@ Ticks, tick labels and Offset text Axis.get_offset_text Axis.get_tick_padding + Axis.get_tick_params Axis.get_ticklabels Axis.get_ticklines Axis.get_ticklocs From 25f9e2e00801a0174605611b3f34a2025f4f53cf Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sat, 5 Nov 2022 20:54:45 -0400 Subject: [PATCH 07/12] Add what's new entry. --- .../next_whats_new/view_current_axis_format.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/users/next_whats_new/view_current_axis_format.rst diff --git a/doc/users/next_whats_new/view_current_axis_format.rst b/doc/users/next_whats_new/view_current_axis_format.rst new file mode 100644 index 000000000000..ed5171110e36 --- /dev/null +++ b/doc/users/next_whats_new/view_current_axis_format.rst @@ -0,0 +1,16 @@ +View current appearance settings for ticks, tick labels, and gridlines +---------------------------------------------------------------------- + +The new `~matplotlib.axis.Axis.get_tick_params` method can be used to +retrieve the appearance settings that will be applied to any +additional ticks, tick labels, and gridlines added to the plot: + +.. code-block:: python + + import matplotlib.pyplot as plt + + fig, ax = plt.subplots() + ax.yaxis.set_tick_params(labelsize=30, labelcolor='red', + direction='out', which='major') + print(ax.yaxis.get_tick_params(which='major')) + print(ax.yaxis.get_tick_params(which='minor')) From 09fdafa073b33d94e8d27c69bee48776a5c01e5d Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sat, 5 Nov 2022 21:34:58 -0400 Subject: [PATCH 08/12] Tweak docstring phrasing. --- lib/matplotlib/axis.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index 1e1a3ab900c8..2a06970f25c0 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -967,14 +967,14 @@ def get_tick_params(self, which='major'): Returns ------- dict - Default properties for styling *new* elements added to this axis. + Properties for styling *new* elements added to this axis. Notes ----- - This method returns the default values for styling *new* elements - added to this axis and may be different from the values on current - elements, if they were modified directly by the user (e.g., via - ``set_*`` methods on individual tick objects). + This method returns the appearance parameters for styling *new* + elements added to this axis and may be different from the values + on current elements, if they were modified directly by the user + (e.g., via ``set_*`` methods on individual tick objects). Examples -------- From 5a5cb4c49b75345abda3a547f3b967bf04b63cb8 Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Fri, 11 Nov 2022 17:19:23 -0700 Subject: [PATCH 09/12] Apply suggestions from code review Co-authored-by: Jody Klymak --- lib/matplotlib/axis.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index 2a06970f25c0..1cdc4c57baf3 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -967,13 +967,13 @@ def get_tick_params(self, which='major'): Returns ------- dict - Properties for styling *new* elements added to this axis. + Properties for styling tick elements added to the axis. Notes ----- This method returns the appearance parameters for styling *new* elements added to this axis and may be different from the values - on current elements, if they were modified directly by the user + on current elements if they were modified directly by the user (e.g., via ``set_*`` methods on individual tick objects). Examples @@ -998,8 +998,6 @@ def get_tick_params(self, which='major'): 'labelright': False, 'gridOn': False} - This allows us to confirm without visual inspection of the plot - that our styling is having the desired effect. """ _api.check_in_list(['major', 'minor'], which=which) From 29825d2cf7dc1aa7c36dd11428329425d29aed5b Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Fri, 11 Nov 2022 19:23:39 -0500 Subject: [PATCH 10/12] Change defaults to settings in docstrings. --- lib/matplotlib/axes/_base.py | 2 +- lib/matplotlib/axis.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index d8a9ebe394a6..d3ea2cd0e9ac 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -3404,7 +3404,7 @@ def tick_params(self, axis='both', **kwargs): Tick properties that are not explicitly set using the keyword arguments remain unchanged unless *reset* is True. For the current - style defaults, see `.Axis.get_tick_params`. + style settings, see `.Axis.get_tick_params`. Parameters ---------- diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index 1cdc4c57baf3..d2fe97df3067 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -920,7 +920,7 @@ def set_tick_params(self, which='major', reset=False, **kwargs): See Also -------- .Axis.get_tick_params - View the current style defaults for ticks, ticklabels, and + View the current style settings for ticks, ticklabels, and gridlines. """ _api.check_in_list(['major', 'minor', 'both'], which=which) From 3456f389770d33ff37762bf5f78f5bdceef35516 Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Fri, 11 Nov 2022 19:02:03 -0700 Subject: [PATCH 11/12] Add outputs to example in what's new. --- .../view_current_axis_format.rst | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/doc/users/next_whats_new/view_current_axis_format.rst b/doc/users/next_whats_new/view_current_axis_format.rst index ed5171110e36..eb7e03600f0e 100644 --- a/doc/users/next_whats_new/view_current_axis_format.rst +++ b/doc/users/next_whats_new/view_current_axis_format.rst @@ -5,12 +5,25 @@ The new `~matplotlib.axis.Axis.get_tick_params` method can be used to retrieve the appearance settings that will be applied to any additional ticks, tick labels, and gridlines added to the plot: -.. code-block:: python +.. code-block:: pycon - import matplotlib.pyplot as plt + >>> import matplotlib.pyplot as plt - fig, ax = plt.subplots() - ax.yaxis.set_tick_params(labelsize=30, labelcolor='red', - direction='out', which='major') - print(ax.yaxis.get_tick_params(which='major')) - print(ax.yaxis.get_tick_params(which='minor')) + >>> fig, ax = plt.subplots() + >>> ax.yaxis.set_tick_params(labelsize=30, labelcolor='red', + ... direction='out', which='major') + >>> ax.yaxis.get_tick_params(which='major') + {'direction': 'out', + 'left': True, + 'right': False, + 'labelleft': True, + 'labelright': False, + 'gridOn': False, + 'labelsize': 30, + 'labelcolor': 'red'} + >>> ax.yaxis.get_tick_params(which='minor') + {'left': True, + 'right': False, + 'labelleft': True, + 'labelright': False, + 'gridOn': False} From 6920dc81a5cd6bf72a3f7b9eb3227856427eaad7 Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sat, 12 Nov 2022 13:22:50 -0500 Subject: [PATCH 12/12] Add versionadded directive for get_tick_params(). --- lib/matplotlib/axis.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index d2fe97df3067..ae38dd28676b 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -959,6 +959,8 @@ def get_tick_params(self, which='major'): """ Get appearance parameters for ticks, ticklabels, and gridlines. + .. versionadded:: 3.7 + Parameters ---------- which : {'major', 'minor'}, default: 'major'