aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2020-01-26 15:07:49 -0500
committerHolden Rohrer <hr@hrhr.dev>2020-01-26 15:07:49 -0500
commit2656662a623932897142ba431cce128247c482ff (patch)
treece2a5b4277c9ea012cd9883c9b980eadef6bfe07
parent2c42179d6e7560ebfbe916939f4aabb93edbd67b (diff)
depth-width now has big dots to mean a lot of points
-rw-r--r--data.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/data.py b/data.py
index 050d4b7..7f5967d 100644
--- a/data.py
+++ b/data.py
@@ -43,7 +43,7 @@ class Trial:
vor = Voronoi([pit.loc for pit in self.pits])
voronoi_plot_2d(vor)
for pit in self.pits:
- plt.text(pit[0], pit[1], pit.disp(), ha='center', va='bottom', size='xx-small')
+ plt.text(pit[0], pit[1], pit.disp(), ha='center', va='bottom', size='small')
plt.xlabel('%s (dimension %dx%dcm)' % (str(self.date), self.size[0], self.size[1]))
if save:
plt.savefig(str(self.date)+'.png', bbox_inches='tight')
@@ -107,6 +107,7 @@ from sys import argv
from math import sqrt
from numpy import poly1d, polyfit
from scipy.stats import pearsonr
+from collections import Counter
if len(argv) < 2:
print('You must provide at least one argument to choose the function of this program: `img` or `nei` or `depwid')
@@ -145,8 +146,10 @@ elif arg == 'depwid':
sizes.append(size)
depths.append(pit.depth)
widths.append(pit.diam)
- plt.plot([size-.5 for size in sizes], depths, 'bo', label='depth')
- plt.plot(sizes, widths, 'ro', label='width')
+ 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')