From 2656662a623932897142ba431cce128247c482ff Mon Sep 17 00:00:00 2001
From: Holden Rohrer
Date: Sun, 26 Jan 2020 15:07:49 -0500
Subject: depth-width now has big dots to mean a lot of points
---
data.py | 9 ++++++---
1 file 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')
--
cgit