aboutsummaryrefslogtreecommitdiff
path: root/python/neighbor.py
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2020-07-06 18:20:32 -0400
committerHolden Rohrer <hr@hrhr.dev>2020-07-06 18:41:47 -0400
commita1d245cfd1979ec78bbc01e5125af80071f8cc42 (patch)
tree9bf0ec38631e4f0879940dc4a0b133d78fc2f17c /python/neighbor.py
parent5a18c8a33b90003a2c930a207f766800883c3622 (diff)
File reorganization
More makefile-friendly
Diffstat (limited to 'python/neighbor.py')
-rw-r--r--python/neighbor.py21
1 files changed, 0 insertions, 21 deletions
diff --git a/python/neighbor.py b/python/neighbor.py
deleted file mode 100644
index 004979a..0000000
--- a/python/neighbor.py
+++ /dev/null
@@ -1,21 +0,0 @@
-from data import trials
-from scipy.stats import pearsonr
-from numpy import poly1d, polyfit
-from math import sqrt
-import matplotlib.pyplot as plt
-
-x = []
-y = []
-for trial in trials:
- size = sqrt(trial.size[0]*trial.size[1])
- nei = trial.nearest_neighbor()
- x.append(size)
- y.append(sum(nei)/len(nei))
-fig = plt.figure()
-ax = fig.add_subplot(111)
-plt.text(0.1, 0.9, 'R^2 = %.3f\np=%.3f' % (pearsonr(x,y)[0]**2, pearsonr(x,y)[1]), ha='center', va='center', transform=ax.transAxes)
-plt.xlabel('Square root of Trial Area (cm)')
-plt.ylabel('Nearest Neighbor for Individual Pits (cm)')
-plt.plot(x, y, 'bo')
-plt.plot(x, poly1d(polyfit(x, y, 1))(x))
-plt.savefig('nearest_neighbor.png', bbox_inches='tight')