MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / grab_frame

Method grab_frame

lib/matplotlib/animation.py:454–465  ·  view source on GitHub ↗
(self, **savefig_kwargs)

Source from the content-addressed store, hash-verified

452 return self.fname_format_str % (self.temp_prefix, self.frame_format)
453
454 def grab_frame(self, **savefig_kwargs):
455 # docstring inherited
456 # Creates a filename for saving using basename and counter.
457 _validate_grabframe_kwargs(savefig_kwargs)
458 path = Path(self._base_temp_name() % self._frame_counter)
459 self._temp_paths.append(path) # Record the filename for later use.
460 self._frame_counter += 1 # Ensures each created name is unique.
461 _log.debug('FileMovieWriter.grab_frame: Grabbing frame %d to path=%s',
462 self._frame_counter, path)
463 with open(path, 'wb') as sink: # Save figure to the sink.
464 self.fig.savefig(sink, format=self.frame_format, dpi=self.dpi,
465 **savefig_kwargs)
466
467 def finish(self):
468 # Call run here now that all frame grabbing is done. All temp files

Callers

nothing calls this directly

Calls 4

_base_temp_nameMethod · 0.95
PathClass · 0.85
savefigMethod · 0.45

Tested by

no test coverage detected