-
Notifications
You must be signed in to change notification settings - Fork 0
/
pisanoPlot.py
74 lines (55 loc) · 1.52 KB
/
pisanoPlot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import matplotlib.pyplot as plt
import random
import numpy as np
from matplotlib import cm
sequence = [1]
n = 0
while n < 20:
sequence.append(sequence[n] + sequence[n-1])
n += 1
psequence = []
pseqflip = []
pisano = 1
plist = []
plistback = []
plistflip = []
pflipback = []
for y in range(10):
for item in sequence:
if item % pisano != 0:
psequence.append(item % pisano)
pseqflip.append(item % pisano)
pisano += 1
plist.append(psequence)
plistback.append(psequence[::-1])
for item in psequence:
plistflip.append(9-item)
for item in psequence[::-1]:
pflipback.append(9-item)
psequence = []
plt.subplot(111, axisbg='black')
width = 2
color1 = (random.random())
color2 = (random.random())
color3 = (random.random())
for item in plist:
plt.plot(item, color=(color1, color2, color3), linewidth=width)
color1 = (random.random())
color2 = (random.random())
color3 = (random.random())
for item in plistback:
plt.plot(item, color=(color1, color2, color3), linewidth=width)
color1 = (random.random())
color2 = (random.random())
color3 = (random.random())
for item in plistflip:
plt.plot(item, color=(color1, color2, color3), linewidth=width)
color1 = (random.random())
color2 = (random.random())
color3 = (random.random())
for item in pflipback:
plt.plot(item, color=(color1, color2, color3), linewidth=width)
color1 = (random.random())
color2 = (random.random())
color3 = (random.random())
plt.show()