Skip to content

Commit 02d7cf8

Browse files
committed
Change stack level of Figure.gca warning.
Raising the warning on the current level breaks tests on Python 2.7 which doesn't reset the warning filter correctly.
1 parent c8fc318 commit 02d7cf8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/figure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,7 @@ def gca(self, **kwargs):
15551555
else:
15561556
warnings.warn('Requested projection is different from '
15571557
'current axis projection, creating new axis '
1558-
'with requested projection.')
1558+
'with requested projection.', stacklevel=2)
15591559

15601560
# no axes found, so create one which spans the figure
15611561
return self.add_subplot(1, 1, 1, **kwargs)

0 commit comments

Comments
 (0)