Skip to content

Commit 09ca4e0

Browse files
committed
Docs: fix file save section
Signed-off-by: martinRenou <[email protected]>
1 parent 1dc749c commit 09ca4e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/source/retrieve_images.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ Note that this won't work if executed in the same Notebook cell. Because the Can
3131
3232
canvas = Canvas(width=200, height=200, sync_image_data=True)
3333
34-
# Perform some drawings...
35-
3634
def save_to_file(*args, **kwargs):
3735
canvas.to_file('my_file.png')
3836
3937
# Listen to changes on the ``image_data`` trait and call ``save_to_file`` when it changes.
4038
canvas.observe(save_to_file, 'image_data')
4139
40+
# Perform some drawings...
41+
4242
Get image data as a NumPy array
4343
-------------------------------
4444

@@ -63,11 +63,11 @@ Note that this won't work if executed in the same Notebook cell. Because the Can
6363
6464
canvas = Canvas(width=200, height=200, sync_image_data=True)
6565
66-
# Perform some drawings...
67-
6866
def get_array(*args, **kwargs):
6967
arr = canvas.get_image_data()
7068
# Do something with arr
7169
7270
# Listen to changes on the ``image_data`` trait and call ``get_array`` when it changes.
7371
canvas.observe(get_array, 'image_data')
72+
73+
# Perform some drawings...

0 commit comments

Comments
 (0)