Skip to content

Commit bda88df

Browse files
committed
DOC: artist extent
1 parent e9179c3 commit bda88df

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/users/faq/howto_faq.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ ticks:
7171
ax.plot(x, y)
7272

7373

74+
.. _howto-determine-artist-extent:
75+
76+
Determine the extent of Artists on the Figure
77+
---------------------------------------------
78+
79+
Sometimes we want to know the extent of an Artist. Matplotlib `.Artist` objects
80+
have a method `.Artist.get_window_extent` that will usually return the extent of
81+
the artist in pixels. However, some artists, in particular text, must be
82+
rendered at least once before their extent is known. Matplotlib supplies
83+
`.Figure.draw_without_rendering`, which should be called before calling
84+
``get_window_extent``.
85+
7486
.. _howto-figure-empty:
7587

7688
Check whether a figure is empty

0 commit comments

Comments
 (0)