Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 244dd18

Browse files
committed
DOC : added warning to doc of get_window_extent
This is in response to issues raised in #2831. Closes #3055
1 parent a86019d commit 244dd18

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

lib/matplotlib/artist.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,13 @@ def get_window_extent(self, renderer):
193193
Subclasses should override for inclusion in the bounding box
194194
"tight" calculation. Default is to return an empty bounding
195195
box at 0, 0.
196+
197+
Be careful when using this function, the results will not update
198+
if the artist window extent of the artist changes. The extent can
199+
change due to any changes in the transform stack, such as changing
200+
the axes limits, the figure size, or the canvas used (as is done when
201+
saving a figure). This can lead to expected behavior where interactive
202+
figures will look fine on the screen, but will save incorrectly.
196203
"""
197204
return Bbox([[0, 0], [0, 0]])
198205

@@ -644,7 +651,7 @@ def set_clip_on(self, b):
644651
"""
645652
Set whether artist uses clipping.
646653
647-
When False artists will be visible out side of the axes which
654+
When False artists will be visible out side of the axes which
648655
can lead to unexpected results.
649656
650657
ACCEPTS: [True | False]

0 commit comments

Comments
 (0)