diff options
Diffstat (limited to 'data.py')
-rw-r--r-- | data.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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') |