diff options
Diffstat (limited to 'py/table.py')
-rw-r--r-- | py/table.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/py/table.py b/py/table.py index 1d11779..8b6b38a 100644 --- a/py/table.py +++ b/py/table.py @@ -1,15 +1,14 @@ from data import trials -print('\\vtable{') -table = ['Dimensions (in)', 'Pit Depth (cm)', 'Pit Width (cm)', 'Nearest Neighbor (cm)','']; -lastsize = 0; for trial in trials: - size = trial.size - table[0] += '&\\multispan{' + str(len(trial.pits)) + '}\\vfil\\line{\\hfil' + '$\\times$'.join([str(el) for el in size]) + '\\hfil}\\vfil\\hrule' + print('\\multirow{' + str(len(trial.pits)) + '}{' + + '$\\times$'.join([str(el) for el in trial.size]) + '}') nei = trial.nearest_neighbor() - for pitind in range(len(trial.pits)): + pitcnt = len(trial.pits) + for pitind in range(pitcnt): pit = trial.pits[pitind] - table[1] += '&' + '%.1f' % pit.depth - table[2] += '&' + '%.1f' % pit.diam - table[3] += '&' + '%.2f' % nei[pitind] -print('\\cr\\noalign{\\vrule}\n'.join(table) + '}', end=''); + print('& %.1f& %.1f& %.2f\\cr' % (pit.depth, pit.diam, nei[pitind])) + if pitind+1 == pitcnt: + break + print('\\cline'); + print('\\multispan{4}\\leaders\\hrule\\hfil\\cr') |