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

Skip to content

Changed return type of get_{x,y}ticklabels to plain list #17028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions doc/api/api_changes_3.3/behaviour.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ deprecation warning.
`~.Axes.errorbar` now color cycles when only errorbar color is set
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Previously setting the *ecolor* would turn off automatic color cycling for the plot, leading to the
the lines and markers defaulting to whatever the first color in the color cycle was in the case of
multiple plot calls.
Previously setting the *ecolor* would turn off automatic color cycling for the plot, leading to the
the lines and markers defaulting to whatever the first color in the color cycle was in the case of
multiple plot calls.

`.rcsetup.validate_color_for_prop_cycle` now always raises TypeError for bytes input
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -156,6 +156,14 @@ support for it will be dropped in a future Matplotlib release.
Previously, keyword arguments were silently ignored when no positional
arguments were given.

`.Axis.get_minorticklabels` and `.Axis.get_majorticklabels` now returns plain list
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Previously, `.Axis.get_minorticklabels` and `.Axis.get_majorticklabels` returns
silent_list. Their return type is now changed to normal list.
`.get_xminorticklabels`, `.get_yminorticklabels`, `.get_zminorticklabels`,
`.Axis.get_ticklabels`, `.get_xmajorticklabels`, `.get_ymajorticklabels` and
`.get_zmajorticklabels` methods will be affected by this change.

Default slider formatter
~~~~~~~~~~~~~~~~~~~~~~~~
The default method used to format `.Slider` values has been changed to use a
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1172,14 +1172,14 @@ def get_majorticklabels(self):
ticks = self.get_major_ticks()
labels1 = [tick.label1 for tick in ticks if tick.label1.get_visible()]
labels2 = [tick.label2 for tick in ticks if tick.label2.get_visible()]
return cbook.silent_list('Text major ticklabel', labels1 + labels2)
return labels1 + labels2

def get_minorticklabels(self):
"""Return this Axis' minor tick labels, as a list of `~.text.Text`."""
ticks = self.get_minor_ticks()
labels1 = [tick.label1 for tick in ticks if tick.label1.get_visible()]
labels2 = [tick.label2 for tick in ticks if tick.label2.get_visible()]
return cbook.silent_list('Text minor ticklabel', labels1 + labels2)
return labels1 + labels2

def get_ticklabels(self, minor=False, which=None):
"""
Expand Down