mpl_toolkits.axisartist.axis_artist.LabelBase

class mpl_toolkits.axisartist.axis_artist.LabelBase(*kl, **kwargs) [source]

Bases: matplotlib.text.Text

A base class for AxisLabel and TickLabels. The position and angle of the text are calculated by to offset_ref_angle, text_ref_angle, and offset_radius attributes.

draw(renderer) [source]

Draws the Text object to the given renderer.

get_window_extent(renderer) [source]

Return a Bbox object bounding the text, in display units.

In addition to being used internally, this is useful for specifying clickable regions in a png file on a web page.

renderer defaults to the _renderer attribute of the text object. This is not assigned until the first execution of draw(), so you must use this kwarg if you want to call get_window_extent prior to the first draw. For getting web page regions, it is simpler to call the method after saving the figure.

dpi defaults to self.figure.dpi; the renderer dpi is irrelevant. For the web application, if figure.dpi is not the value used when saving the figure, then the value that was used must be specified as the dpi argument.

© 2012–2018 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.0.0/api/_as_gen/mpl_toolkits.axisartist.axis_artist.LabelBase.html