Data exercise ============= Look at `this page from the Particle Data Group `_. It has plots and data files for the *total collision cross section* of :math:`\pi^-p` and :math:`\pi^+p` collisions. Instead of the two separate plots, we would like to have both lines on a single figure. Using the command line tools we discussed in the previous sessions, you should download the data files, extract the relevant columns and produce a plot using :command:`gnuplot`. We'll introduce other plotting tools for data sets later. Gnuplot expects a data file with one plot point per line, in six columns: each line should contain the points with error bar information in the format :kbd:`x y xlow xhigh ylow yhigh`. Convert the data files from the PDG website into this format. (:command:`awk` from previous weeks will be useful, it lets you calculate with column references: :kbd:`$2 + $3`). After converting the data into the correct format, a simple :command:`gnuplot` session looks like:: $ gnuplot [... some splash text ...] gnuplot> set logscale gnuplot> plot 'filename1' with xyerrorbars, 'filename2' with xyerrorbars gnuplot> quit Instead of entering these instructions into a gnuplot session one by one, you can also save them in a file, say :file:`plot.gnu`, and call:: $ gnuplot plot.gnu To create the plot in a PDF file which you can import in a :math:`\LaTeX` document, call:: set terminal pdf set output 'foo.pdf' before the plot command. :command:`gnuplot` has very detailed information accessible through its :kbd:`help` command.