import climate
import itertools
import lmj.plot
import numpy as np

import database
import plots


@climate.annotate(
    root='plot data from this experiment subjects',
    pattern=('plot data from files matching this pattern', 'option'),
)
def main(root, pattern='*/*block*/*circuit*.csv.gz'):
    with plots.plot() as ax:
        for trial in database.Experiment(root).trials_matching(pattern):
            for t in range(12):
                s = trial.movement_to(t).distance_to_target().interpolate().reset_index(drop=True)
                ax.plot(s.index, s.values, color=lmj.plot.COLOR11[t % 11])


if __name__ == '__main__':
    climate.call(main)

@@ -267,17 +267,18 @@
 */*block
-*
+03
 /*circui
@@ -278,17 +278,18 @@
 *circuit
-*
+00
 .csv.gz'
@@ -504,31 +504,8 @@
 te()
-.reset_index(drop=True)
 %0A   
@@ -529,15 +529,28 @@
 lot(
-s.index
+range(len(s.values))
 , s.
@@ -555,16 +555,22 @@
 s.values
+%5B::-1%5D
 , color=
@@ -595,16 +595,107 @@
  %25 11%5D)%0A
+        ax.set_xlabel('Frames Before Contact')%0A        ax.set_ylabel('Distance to Target')%0A
 %0A%0Aif __n

Add axis labels.