diff options
author | Holden Rohrer <hr@hrhr.dev> | 2020-07-06 18:20:32 -0400 |
---|---|---|
committer | Holden Rohrer <hr@hrhr.dev> | 2020-07-06 18:41:47 -0400 |
commit | a1d245cfd1979ec78bbc01e5125af80071f8cc42 (patch) | |
tree | 9bf0ec38631e4f0879940dc4a0b133d78fc2f17c /python/depwid.py | |
parent | 5a18c8a33b90003a2c930a207f766800883c3622 (diff) |
File reorganization
More makefile-friendly
Diffstat (limited to 'python/depwid.py')
-rw-r--r-- | python/depwid.py | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/python/depwid.py b/python/depwid.py deleted file mode 100644 index 081167f..0000000 --- a/python/depwid.py +++ /dev/null @@ -1,22 +0,0 @@ -from data import trials -from math import sqrt -from scipy.stats import pearsonr -from collections import Counter -import matplotlib.pyplot as plt - -depths, widths, sizes = [], [], [] -for trial in trials: - size = sqrt(trial.size[0]*trial.size[1]) - for pit in trial.pits: - sizes.append(size) - depths.append(pit.depth) - widths.append(pit.diam) -weights = [20*i for i in Counter(depths).values() for j in range(i)] -plt.scatter([size-.5 for size in sizes], depths, weights, 'b','o', label='depth') -weights = [20*i for i in Counter(widths).values() for j in range(i)] -plt.scatter(sizes, widths, weights, 'r', 'o', label='width') -plt.xlabel('Square root of Trial Area (cm)') -plt.ylabel('Depth/Width of Antlion Pits (cm)') -plt.legend(loc='upper right') -plt.text(10, 7, 'R^2 = %.3f\np=%.3f' % (pearsonr(sizes,depths)[0], pearsonr(sizes,depths)[1]), ha='center', va='center') -plt.savefig('depth_width.png', bbox_inches='tight') |