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

Method _init_draw

lib/matplotlib/animation.py:1764–1794  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1762 return itertools.islice(self.new_frame_seq(), self._save_count)
1763
1764 def _init_draw(self):
1765 super()._init_draw()
1766 # Initialize the drawing either using the given init_func or by
1767 # calling the draw function with the first item of the frame sequence.
1768 # For blitting, the init_func should return a sequence of modified
1769 # artists.
1770 if self._init_func is None:
1771 try:
1772 frame_data = next(self.new_frame_seq())
1773 except StopIteration:
1774 # we can't start the iteration, it may have already been
1775 # exhausted by a previous save or just be 0 length.
1776 # warn and bail.
1777 warnings.warn(
1778 "Can not start iterating the frames for the initial draw. "
1779 "This can be caused by passing in a 0 length sequence "
1780 "for *frames*.\n\n"
1781 "If you passed *frames* as a generator "
1782 "it may be exhausted due to a previous display or save."
1783 )
1784 return
1785 self._draw_frame(frame_data)
1786 else:
1787 self._drawn_artists = self._init_func()
1788 if self._blit:
1789 if self._drawn_artists is None:
1790 raise RuntimeError('When blit=True, the init_func must '
1791 'return a sequence of Artist objects.')
1792 for a in self._drawn_artists:
1793 a.set_animated(self._blit)
1794 self._save_seq.clear()
1795
1796 def _draw_frame(self, framedata):
1797 if self._cache_frame_data:

Calls 5

new_frame_seqMethod · 0.95
_draw_frameMethod · 0.95
_init_drawMethod · 0.45
set_animatedMethod · 0.45
clearMethod · 0.45