Scripts

Scripts and tricks for various scientific purposes

List of documents

Title Format Tags
Klein-Nishina cross section Mathematica Klein-Nishina, Mathematica
Klein-Nishina cross section Gnuplot Klein-Nishina, Gnuplot
Klein-Nishina cross section ROOT Klein-Nishina, Gnuplot

Convert Gnuplot EPS output to PDF with crop and rotation function

When using gnuplot postscript enhanced color terminal output, you get eps as output. There are several options for converting to PDF.
  1. Import with inkscape, press F2 and select background/white canvas and press SUPR. Then Save As PDF, only drawing. Or with inkscape --export-area-drawing --export-pdf=out.pdf input.eps
  2. Using epstopdf: epstopdf --autorotate=All -outfile=outputfile.pdf inputfile.eps
  3. Using ghostscript: gs -sDEVICE=bbox -dBATCH -dNOPAUSE fileInput.eps 2>&1 | grep '%%HiResBoundingBox' | awk '{print $2, $3, $4, $5}'>/tmp/bbox;
    gs -q -o fileOutput.pdf -sDEVICE=pdfwrite -c "[/CropBox [...] /PAGES pdfmark" -f fileInput.eps;
Here some sample scripts (tested with LINUX) for doing advanced conversion with rotation and cropping. Customize the scripts by yourself according to your interests.
  1. C++
  2. Python