Bases: Artist
An artist which draws axis (a line along which the n-th axes coord is constant) line, ticks, tick labels, and axis label.
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (Artist.get_visible returns False).
RendererBase subclass.
This method is overridden in the Artist subclasses.
Return the current axisline style.
Return axis artist helper instance.
Like Artist.get_window_extent, but includes any clipping.
RendererBase subclass, optional
renderer that will be used to draw the figures (i.e. fig.canvas.get_renderer())
Bbox or NoneThe enclosing bounding box (in figure pixel coordinates). Returns None if clipping results in no intersection.
Set multiple properties at once.
Supported properties are
Property | Description |
|---|---|
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image | |
scalar or None | |
bool | |
{"left", "bottom", "right", "top"} | |
{"+", "-"} | |
str or None | |
| |
bool | |
Patch or (Path, Transform) or None | |
str | |
bool | |
unknown | |
bool | |
list of | |
None or bool or float or callable | |
bool | |
(scale: float, length: float, randomness: float) | |
bool or None | |
{"+", "-"} | |
str | |
bool | |
float |
Adjust the direction, text angle, and text alignment of tick labels and axis labels following the Matplotlib convention for the rectangle axes.
The axis_direction must be one of [left, right, bottom, top].
Property | left | bottom | right | top |
|---|---|---|---|---|
ticklabel direction | "-" | "+" | "+" | "-" |
axislabel direction | "-" | "+" | "+" | "-" |
ticklabel angle | 90 | 0 | -90 | 180 |
ticklabel va | center | baseline | center | baseline |
ticklabel ha | right | center | right | center |
axislabel angle | 180 | 0 | 0 | 180 |
axislabel va | center | top | center | bottom |
axislabel ha | right | center | right | center |
Note that the direction "+" and "-" are relative to the direction of the increasing coordinate. Also, the text angles are actually relative to (90 + angle of the direction to the ticklabel), which gives 0 for bottom axis.
Adjust the direction of the axis label.
Note that the label_directions '+' and '-' are relative to the direction of the increasing coordinate.
Set the axisline style.
The new style is completely defined by the passed attributes. Existing style attributes are forgotten.
The line style, e.g. '->', optionally followed by a comma-separated list of attributes. Alternatively, the attributes can be provided as keywords.
If None this returns a string containing the available styles.
The following two commands are equal:
>>> set_axisline_style("->,size=1.5")
>>> set_axisline_style("->", size=1.5)
Set a label that will be displayed in the legend.
s will be converted to a string by calling str.
Adjust the direction of the tick labels.
Note that the tick_directions '+' and '-' are relative to the direction of the increasing coordinate.
Toggle visibility of ticks, ticklabels, and (axis) label. To turn all off,
axis.toggle(all=False)
To turn all off but ticks on
axis.toggle(all=False, ticks=True)
To turn all on but (axis) label off
axis.toggle(all=True, label=False)
mpl_toolkits.axisartist.axis_artist.AxisArtist
© 2012–2023 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/stable/api/_as_gen/mpl_toolkits.axisartist.axis_artist.AxisArtist.html