MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / set_ticklabels

Method set_ticklabels

lib/matplotlib/axis.py:2177–2307  ·  view source on GitHub ↗

r""" [*Discouraged*] Set this Axis' tick labels with list of string labels. .. admonition:: Discouraged The use of this method is discouraged, because of the dependency on tick positions. In most cases, you'll want to use ``Axes.set_[x/y/z]ticks(

(self, labels, *, minor=False, fontdict=None, **kwargs)

Source from the content-addressed store, hash-verified

2175 return tickd.get(x, "")
2176
2177 def set_ticklabels(self, labels, *, minor=False, fontdict=None, **kwargs):
2178 r"""
2179 [*Discouraged*] Set this Axis' tick labels with list of string labels.
2180
2181 .. admonition:: Discouraged
2182
2183 The use of this method is discouraged, because of the dependency on
2184 tick positions. In most cases, you'll want to use
2185 ``Axes.set_[x/y/z]ticks(positions, labels)`` or ``Axis.set_ticks``
2186 instead.
2187
2188 If you are using this method, you should always fix the tick
2189 positions before, e.g. by using `.Axis.set_ticks` or by explicitly
2190 setting a `~.ticker.FixedLocator`. Otherwise, ticks are free to
2191 move and the labels may end up in unexpected positions.
2192
2193 Parameters
2194 ----------
2195 labels : sequence of str or of `.Text`\s
2196 Texts for labeling each tick location in the sequence set by
2197 `.Axis.set_ticks`; the number of labels must match the number of locations.
2198 The labels are used as is, via a `.FixedFormatter` (without further
2199 formatting).
2200
2201 minor : bool
2202 If True, set minor ticks instead of major ticks.
2203
2204 fontdict : dict, optional
2205
2206 .. admonition:: Discouraged
2207
2208 The use of *fontdict* is discouraged. Parameters should be passed as
2209 individual keyword arguments or using dictionary-unpacking
2210 ``set_ticklabels(..., **fontdict)``.
2211
2212 A dictionary controlling the appearance of the ticklabels.
2213 The default *fontdict* is::
2214
2215 {'fontsize': rcParams['axes.titlesize'],
2216 'fontweight': rcParams['axes.titleweight'],
2217 'verticalalignment': 'baseline',
2218 'horizontalalignment': loc}
2219
2220 **kwargs
2221 Text properties.
2222
2223 .. warning::
2224
2225 This only sets the properties of the current ticks, which is
2226 only sufficient for static plots.
2227
2228 Ticks are not guaranteed to be persistent. Various operations
2229 can create, delete and modify the Tick instances. There is an
2230 imminent risk that these settings can get lost if you work on
2231 the figure further (including also panning/zooming on a
2232 displayed figure).
2233
2234 Use `.set_tick_params` instead if possible.

Callers 7

set_ticksMethod · 0.95
barMethod · 0.45
convertMethod · 0.45
text_intro.pyFile · 0.45

Calls 14

get_minor_locatorMethod · 0.95
get_major_locatorMethod · 0.95
set_minor_formatterMethod · 0.95
get_minorticklocsMethod · 0.95
get_minor_ticksMethod · 0.95
set_major_formatterMethod · 0.95
get_majorticklocsMethod · 0.95
get_major_ticksMethod · 0.95
_internal_updateMethod · 0.80
get_textMethod · 0.45
updateMethod · 0.45
update_positionMethod · 0.45