Skip to content

Commit 2d43258

Browse files
committed
Merge pull request matplotlib#3184 from tacaswell/get_window_extent_doc
DOC : added warning to doc of get_window_extent
2 parents a1cfa29 + b0c4bb0 commit 2d43258

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: lib/matplotlib/artist.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,14 @@ 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
199+
can change due to any changes in the transform stack, such as
200+
changing the axes limits, the figure size, or the canvas used
201+
(as is done when saving a figure). This can lead to unexpected
202+
behavior where interactive figures will look fine on the screen,
203+
but will save incorrectly.
196204
"""
197205
return Bbox([[0, 0], [0, 0]])
198206

@@ -644,7 +652,7 @@ def set_clip_on(self, b):
644652
"""
645653
Set whether artist uses clipping.
646654
647-
When False artists will be visible out side of the axes which
655+
When False artists will be visible out side of the axes which
648656
can lead to unexpected results.
649657
650658
ACCEPTS: [True | False]

0 commit comments

Comments
 (0)