diff options
author | Holden Rohrer <hr@hrhr.dev> | 2020-01-26 15:07:49 -0500 |
---|---|---|
committer | Holden Rohrer <hr@hrhr.dev> | 2020-01-26 15:07:49 -0500 |
commit | 2656662a623932897142ba431cce128247c482ff (patch) | |
tree | ce2a5b4277c9ea012cd9883c9b980eadef6bfe07 | |
parent | 2c42179d6e7560ebfbe916939f4aabb93edbd67b (diff) |
depth-width now has big dots to mean a lot of points
-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') |