# import the toolbox and call it B import LT.box as B # read the data mf = B.get_file('my_exp_1.data') # get the data into arrays t = B.get_data(mf, 'time') dexp = B.get_data(mf,'dist') derr = B.get_data(mf, 'd_err') # plot the data B.plot_exp(t, dexp, derr) # fit a line fit = B.linefit(t, dexp, derr) # draw the fit result B.plot_line(fit.xpl, fit.ypl, color = 'r') # plot a red line # add the labels B.pl.xlabel('t (sec)') B.pl.ylabel('Distance (m)') B.pl.title('Distance vs time exp.') # show the plot B.pl.show()