Day 15 (visualize)

This commit is contained in:
Sebastian Seedorf
2020-12-15 23:10:09 +01:00
parent 5a2b9fe23f
commit 20e80270ca
4 changed files with 26 additions and 4 deletions

22
day15/visualize.py Normal file
View File

@@ -0,0 +1,22 @@
from day15.common import yield_numbers
from matplotlib import pyplot as plt
import numpy as np
data = list(map(lambda x: (x[1],len(x[2]),len(x[2])/x[0]), yield_numbers("0,3,6", 30000000)))
data = np.array(data)
plt.plot(
data[:,:2],
linestyle='none',
marker='.',
markersize=1
)
plt.show()
plt.plot(
data[:,2],
linestyle='none',
marker='.',
markersize=1,
color='g'
)
plt.show()