Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung | |||
ws1920:achte_gruppentermin_19.12.19 [2020/01/23 17:12] hannariegel |
ws1920:achte_gruppentermin_19.12.19 [2020/01/23 17:14] (aktuell) hannariegel |
||
---|---|---|---|
Zeile 149: | Zeile 149: | ||
tem = Tripleeinheitsmatrix(zeilen, spalten) | tem = Tripleeinheitsmatrix(zeilen, spalten) | ||
#Wiederholungen(t) | #Wiederholungen(t) | ||
+ | </code> | ||
+ | |||
+ | Ausführungsdatei: | ||
+ | |||
+ | <code> | ||
+ | import GameOfLife as gol | ||
+ | import numpy as np | ||
+ | from matplotlib import pyplot as plt | ||
+ | from matplotlib import animation | ||
+ | import random | ||
+ | import time | ||
+ | |||
+ | def animate(e): | ||
+ | im.set_array(gol.zustand) | ||
+ | gol.Schritt() | ||
+ | return im, | ||
+ | |||
+ | gol.Initialisiere() | ||
+ | |||
+ | #fig = plt.figure(figsize=(1920,1080), dpi=1, frameon=False) | ||
+ | fig = plt.figure() | ||
+ | |||
+ | |||
+ | |||
+ | #fig position ändern | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | plt.axis('off') | ||
+ | |||
+ | #figure(num=None, figsize=(8, 6), dpi=80, facecolor='w', edgecolor='k') | ||
+ | #plt.figure(figsize=(1,1)) | ||
+ | im = plt.imshow(gol.zustand, animated=True, cmap=plt.get_cmap('gray')) | ||
+ | |||
+ | anim = animation.FuncAnimation(fig, animate, interval=200) | ||
+ | #blit ist boese | ||
+ | # | ||
+ | # fuer mint gruen cmap=YlGn | ||
+ | plt.show() | ||
</code> | </code> |