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

Method get_window_extent

lib/matplotlib/artist.py:337–371  ·  view source on GitHub ↗

Get the artist's bounding box in display space, ignoring clipping. The bounding box's width and height are non-negative. Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.

(self, renderer=None)

Source from the content-addressed store, hash-verified

335 self.stale_callback(self, val)
336
337 def get_window_extent(self, renderer=None):
338 """
339 Get the artist's bounding box in display space, ignoring clipping.
340
341 The bounding box's width and height are non-negative.
342
343 Subclasses should override for inclusion in the bounding box "tight"
344 calculation. Default is to return an empty bounding box at 0, 0.
345
346 .. warning::
347
348 The extent can change due to any changes in the transform stack, such
349 as changing the Axes limits, the figure size, the canvas used (as is
350 done when saving a figure), or the DPI.
351
352 Relying on a once-retrieved window extent can lead to unexpected
353 behavior in various cases such as interactive figures being resized or
354 moved to a screen with different dpi, or figures that look fine on
355 screen render incorrectly when saved to file.
356
357 To get accurate results you may need to manually call
358 `~.Figure.savefig` or `~.Figure.draw_without_rendering` to have
359 Matplotlib compute the rendered size.
360
361 Parameters
362 ----------
363 renderer : `~matplotlib.backend_bases.RendererBase`, optional
364 Renderer used to draw the figure (i.e. ``fig.canvas.get_renderer()``).
365
366 See Also
367 --------
368 .Artist.get_tightbbox :
369 Get the artist bounding box, taking clipping into account.
370 """
371 return Bbox([[0, 0], [0, 0]])
372
373 def get_tightbbox(self, renderer=None):
374 """

Callers 1

get_tightbboxMethod · 0.95

Calls 1

BboxClass · 0.85

Tested by

no test coverage detected