File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed
interface/fortran/solution
numpy/game-of-life/solution Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ def init_fields(filename):
33
33
return field , field0
34
34
35
35
def write_field (field , step ):
36
- plt .hold ( False )
36
+ plt .gca (). clear ( )
37
37
plt .imshow (field )
38
38
plt .axis ('off' )
39
39
plt .savefig ('heat_{0:03d}.png' .format (step ))
Original file line number Diff line number Diff line change @@ -52,11 +52,12 @@ def update(board):
52
52
board = initialize (opt .dimension , opt .shape )
53
53
54
54
plt .ion ()
55
- plt .hold ( False )
55
+ plt .gca (). clear ( )
56
56
plt .imshow (board , cmap = plt .cm .prism )
57
57
# pl.savefig('gof_initial.png')
58
58
for iter in range (opt .niter ):
59
59
board = update (board )
60
+ plt .gca ().clear ()
60
61
plt .imshow (board , cmap = plt .cm .prism )
61
62
plt .title ('Generation {0}' .format (iter ))
62
63
plt .draw ()
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def init_fields(filename):
31
31
return field , field0
32
32
33
33
def write_field (field , step ):
34
- plt .hold ( False )
34
+ plt .gca (). clear ( )
35
35
plt .imshow (field )
36
36
plt .axis ('off' )
37
37
plt .savefig ('heat_{0:03d}.png' .format (step ))
You can’t perform that action at this time.
0 commit comments