File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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...
You can’t perform that action at this time.
0 commit comments