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

Method saving

lib/matplotlib/animation.py:211–228  ·  view source on GitHub ↗

Context manager to facilitate writing the movie file. ``*args, **kw`` are any parameters that should be passed to `setup`.

(self, fig, outfile, dpi, *args, **kwargs)

Source from the content-addressed store, hash-verified

209
210 @contextlib.contextmanager
211 def saving(self, fig, outfile, dpi, *args, **kwargs):
212 """
213 Context manager to facilitate writing the movie file.
214
215 ``*args, **kw`` are any parameters that should be passed to `setup`.
216 """
217 if mpl.rcParams['savefig.bbox'] == 'tight':
218 _log.info("Disabling savefig.bbox = 'tight', as it may cause "
219 "frame size to vary, which is inappropriate for "
220 "animation.")
221
222 # This particular sequence is what contextlib.contextmanager wants
223 self.setup(fig, outfile, dpi, *args, **kwargs)
224 with mpl.rc_context({'savefig.bbox': None}):
225 try:
226 yield self
227 finally:
228 self.finish()
229
230
231class MovieWriter(AbstractMovieWriter):

Callers 3

saveMethod · 0.80
test_grabframeFunction · 0.80

Calls 2

setupMethod · 0.95
finishMethod · 0.95

Tested by 1

test_grabframeFunction · 0.64