Skip to content

Commit 91654d2

Browse files
committed
DOC: add comment about buffer overrun at DEBUG
1 parent 1fea02c commit 91654d2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/matplotlib/animation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,8 @@ def _args(self):
669669
'-s', '%dx%d' % self.frame_size, '-pix_fmt', self.frame_format,
670670
'-r', str(self.fps)]
671671
# Logging is quieted because subprocess.PIPE has limited buffer size.
672-
672+
# If you have a lot of frames in your animation and set logging to
673+
# DEBUG, you will have a buffer overrun.
673674
if (_log.getEffectiveLevel() > logging.DEBUG):
674675
args += ['-loglevel', 'quiet']
675676
args += ['-i', 'pipe:'] + self.output_args

lib/matplotlib/axes/_axes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,9 +554,12 @@ def legend(self, *args, **kwargs):
554554
if len(extra_args):
555555
raise TypeError('legend only accepts two non-keyword arguments')
556556
self.legend_ = mlegend.Legend(self, handles, labels, **kwargs)
557-
self.legend_._remove_method = lambda h: setattr(self, 'legend_', None)
557+
self.legend_._remove_method = self._remove_legend
558558
return self.legend_
559559

560+
def _remove_legend(self, legend):
561+
self.legend_ = None
562+
560563
def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
561564
"""
562565
Add text to the axes.

0 commit comments

Comments
 (0)