Skip to content

Commit bf6aa62

Browse files
tacaswellQuLogic
andauthored
DOC: edits from review
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
1 parent 8998de7 commit bf6aa62

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

tutorials/intermediate/blitting.py

+9-11
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
'Blitting' is a `standard technique
77
<https://en.wikipedia.org/wiki/Bit_blit>`__ in computer graphics that
8-
in the context of matplotlib can be used to (drastically) improve
8+
in the context of Matplotlib can be used to (drastically) improve
99
performance of interactive figures. It is used internally by the
1010
:mod:`~.animation` and :mod:`~.widgets` modules for this reason.
1111
@@ -17,7 +17,7 @@
1717
1818
The procedure to save our work is roughly:
1919
20-
- draw the figure, but exclude an artists marked as 'animated'
20+
- draw the figure, but exclude any artists marked as 'animated'
2121
- save a copy of the Agg RBGA buffer
2222
2323
In the future, to update the 'animated' artists we
@@ -67,8 +67,8 @@
6767

6868

6969
###############################################################################
70-
# This example works and shows a simple animation, however because we are only
71-
# grabbing the background once, if the size of dpi of the figure change, the
70+
# The previous example works and shows a simple animation, however because we are only
71+
# grabbing the background once, if the size or dpi of the figure change, the
7272
# background will be invalid and result in incorrect images. There is also a
7373
# global variable and a fair amount of boiler plate which suggests we should
7474
# wrap this in a class.
@@ -107,8 +107,7 @@ def __init__(self, canvas, animated_artists):
107107
self.cid = canvas.mpl_connect('draw_event', self.on_draw)
108108

109109
def on_draw(self, event):
110-
"""Callback to register with 'draw_event'
111-
"""
110+
"""Callback to register with 'draw_event'."""
112111
cv = self.canvas
113112
if event is not None:
114113
if event.canvas != cv:
@@ -117,7 +116,8 @@ def on_draw(self, event):
117116
self._draw_animated()
118117

119118
def add_artist(self, art):
120-
"""Add a artist to be managed
119+
"""
120+
Add an artist to be managed.
121121
122122
Parameters
123123
----------
@@ -132,15 +132,13 @@ def add_artist(self, art):
132132
self._artists.append(art)
133133

134134
def _draw_animated(self):
135-
"""Draw all of the animated artists
136-
"""
135+
"""Draw all of the animated artists."""
137136
fig = self.canvas.figure
138137
for a in self._artists:
139138
fig.draw_artist(a)
140139

141140
def update(self):
142-
"""Update the screen with animated artists
143-
"""
141+
"""Update the screen with animated artists."""
144142
cv = self.canvas
145143
fig = cv.figure
146144
# paranoia in case we missed the draw event,

0 commit comments

Comments
 (0)