aboutsummaryrefslogtreecommitdiff
path: root/data.py
diff options
context:
space:
mode:
Diffstat (limited to 'data.py')
-rw-r--r--data.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/data.py b/data.py
index 3363dbd..ad06b92 100644
--- a/data.py
+++ b/data.py
@@ -154,10 +154,18 @@ elif arg == 'depwid':
plt.text(10, 7, 'R^2 = %.3f\np=%.3f' % (pearsonr(sizes,depths)[0], pearsonr(sizes,depths)[1]), ha='center', va='center')
plt.savefig('depth_width.png', bbox_inches='tight')
if arg == 'table':
- print('Dimensions (in)\tPit Depth (cm)\tPit Width (cm)\tNearest Neighbor (cm)')
+ print('\\table{')
+ print('Dimensions (in)& Pit Depth (cm)& Pit Width (cm)& Nearest Neighbor (cm)')
for trial in trials:
size = trial.size
nei = trial.nearest_neighbor()
for pitind in range(len(trial.pits)):
pit = trial.pits[pitind]
- print('\t'.join(['x'.join([str(el) for el in size]), str(pit.depth), str(pit.diam), str(nei[pitind])]))
+ print('& '.join(['x'.join([str(el) for el in size]), '%.1f' % pit.depth, '%.1f' % pit.diam, '%.2f' % nei[pitind]])+'\\cr\\noalign{\\hrule}')
+ print('}')
+if arg == 'deathtable':
+ print('\\table{')
+ print('Trial Size& Date& Introduced& Deaths& Pits formed\\cr\\noalign{\\hrule}')
+ for trial in trials:
+ print('& '.join(['x'.join([str(el) for el in trial.size]), str(trial.date), str(trial.intro), str(trial.dead), str(len(trial.pits))])+'\\cr\\noalign{\\hrule}')
+ print('}')