How can I animate this in Jupyter Notebook? Any animation will do
Please help to animate this:
def ModularColor(L):
n = len(L)
board = Graphics()
for i in range(2*n):
for j in range(2*n):
k = (i+j)%n
color = L[k]
corners=[(j,i), (j+1,i), (j+1,i+1), (j,i+1)]
chessboard=polygon2d(corners, axes=false, color=color,)
board+=chessboard
return board
KULAYS=['dodgerblue', 'mediumseagreen', 'gold', 'orangered']
ModularColor(KULAYS)
What is it that you would like to animate? I only see one image.
Something like
import itertools
and thenanimate((ModularColor(list(L)) for L in itertools.permutations(KULAYS)))
? Theanimate
function takes a list of images and produces an animation. Is that what you're looking for?that one works. thank you! now that i know that it can be animated, is it possible to animate it differently? like different movement?
My very first question was, "what is it that you would like to animate?" Of course it's possible to animate it differently, but without an example of what you want, I have no idea what to suggest. Anyway, I hope this is enough information to get you started.