8000 Changed return type of get_{x,y}ticklabels to plain list (#17028) · matplotlib/matplotlib@9daaa7d · GitHub
[go: up one dir, main page]

Skip to content

Commit 9daaa7d

Browse files
Changed return type of get_{x,y}ticklabels to plain list (#17028)
* Changed return type of get_{x,y}ticklabels to plain list * list typecasting * Added enhancement changes in behavior.rst * removed axes * changed silent_list to list * removed _base.py changes * modified doc * doc changes * Cross Referencing added * rectified constructor call * rebased * Update doc/api/api_changes_3.3/behaviour.rst Co-Authored-By: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> * Update doc/api/api_changes_3.3/behaviour.rst Co-Authored-By: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> * Update doc/api/api_changes_3.3/behaviour.rst Co-Authored-By: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> * Sphinx edits Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
1 parent 0824d00 commit 9daaa7d

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

doc/api/api_changes_3.3/behaviour.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ deprecation warning.
9898
`~.Axes.errorbar` now color cycles when only errorbar color is set
9999
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
100100

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

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

159+
`.Axis.get_minorticklabels` and `.Axis.get_majorticklabels` now returns plain list
160+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
161+
Previously, `.Axis.get_minorticklabels` and `.Axis.get_majorticklabels` returns
162+
silent_list. Their return type is now changed to normal list.
163+
`.get_xminorticklabels`, `.get_yminorticklabels`, `.get_zminorticklabels`,
164+
`.Axis.get_ticklabels`, `.get_xmajorticklabels`, `.get_ymajorticklabels` and
165+
`.get_zmajorticklabels` methods will be affected by this change.
166+
159167
Default slider formatter
160168
~~~~~~~~~~~~~~~~~~~~~~~~
161169
The default method used to format `.Slider` values has been changed to use a

lib/matplotlib/axis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,14 +1172,14 @@ def get_majorticklabels(self):
11721172
ticks = self.get_major_ticks()
11731173
labels1 = [tick.label1 for tick in ticks if tick.label1.get_visible()]
11741174
labels2 = [tick.label2 for tick in ticks if tick.label2.get_visible()]
1175-
return cbook.silent_list('Text major ticklabel', labels1 + labels2)
1175+
return labels1 + labels2
11761176

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

11841184
def get_ticklabels(self, minor=False, which=None):
11851185
"""

0 commit comments

Comments
 (0)
0