diff options
author | Holden Rohrer <hr@hrhr.dev> | 2020-01-11 23:52:30 -0500 |
---|---|---|
committer | Holden Rohrer <hr@hrhr.dev> | 2020-01-11 23:52:30 -0500 |
commit | 88aa1d9994c3a4e0efc7fb19cc019c4d575cfa73 (patch) | |
tree | 1d11ce85024edd407e876367a646aa73e1bc5d8e | |
parent | c1ef62804f80407b611115fae3771912cde4a241 (diff) |
added legend to depwid
-rw-r--r-- | data.py | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -134,16 +134,17 @@ elif arg == 'nei': plt.ylabel('Nearest Neighbor for Individual Pits (cm)') plt.plot(x, y, 'bo') plt.plot(x, np.poly1d(np.polyfit(x, y, 1))(x)) - plt.show() + plt.savefig('nearest_neighbor.png', bbox='tight') elif arg == 'depwid': for trial in trials: size = math.sqrt(trial.size[0]*trial.size[1]) for pit in trial.pits: - plt.plot(size, pit.depth, 'bo') - plt.plot(size, pit.diam, 'ro') + plt.plot(size, pit.depth, 'bo', label='depth') + plt.plot(size, pit.diam, 'ro', label='width') plt.xlabel('Square root of Trial Area (cm)') plt.ylabel('Depth/Width of Antlion Pits (cm)') - plt.show() + plt.legend(loc='upper right') + plt.savefig('depth_width.png', bbox='tight') if arg == 'table': print('Dimensions (in)\tPit Depth (cm)\tPit Width (cm)\tNearest Neighbor (cm)') for trial in trials: |