From 5bc6c5a166db88790f3f2c8595fd28212c237a0f Mon Sep 17 00:00:00 2001 From: stanley6716 <42953154+stanley6716@users.noreply.github.com> Date: Thu, 12 Jan 2023 01:39:28 +0800 Subject: [PATCH] Update 14.py The origin code might be #13 The following code should be the correct one. import random import pylab dt = pylab.linspace(0, 12 * pylab.pi, 10000) xs = pylab.sin(dt) * ( pylab.exp(pylab.cos(dt)) - 2 * pylab.cos(4 * dt) + (pylab.sin(dt / 12)) ** 5 ) ys = pylab.cos(dt) * ( pylab.exp(pylab.cos(dt)) - 2 * pylab.cos(4 * dt) + (pylab.sin(dt / 12)) ** 5 ) for i in range(5): for j in range(5): c = [random.random() for x in range(3)] pylab.fill(xs + j * 10, ys + i * 10, color=c) for i in range(5): for j in range(5): if i == j or i + j == 4: c = [random.random() for x in range(3)] pylab.fill(xs + (j + 6) * 10, ys + i * 10, color=c) pylab.axis("off") pylab.show() --- src/ch05/14.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ch05/14.py b/src/ch05/14.py index fa56b86..bcff333 100644 --- a/src/ch05/14.py +++ b/src/ch05/14.py @@ -22,3 +22,5 @@ pylab.axis("off") pylab.show() + +# The code is in wrong order.