You are reading an old version of the documentation (v3.1.3). For the latest version see https://matplotlib.org/stable/api/_as_gen/matplotlib.artist.Artist.get_window_extent.html
Version 3.1.3
matplotlib
Fork me on GitHub

matplotlib.artist.Artist.get_window_extent

Artist.get_window_extent(self, renderer)[source]

Get the axes bounding box in display space.

The bounding box' width and height are nonnegative.

Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.

Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.