#!/bin/bash

string="set terminal pdfcairo enhanced size 5,2.7 font ', 12';set out 'graf_2.pdf';set xrange [0:2];set yrange [-40:1200];set xlabel 'time[s]';set ylabel 'superconductor current [A]';"
string="$string plot "
string="$string 'kocman_300_cold_air_1/part_0.j' u 1:3 w l ti '300 turns, air&{r}',"
string="$string 'kocman_300_cold_ferr_2/part_0.j' u 1:3 w l ti '300 turns, ferr',"
string="$string 'kocman_600_cold_air_2/part_0.j' u 1:(\$3*(-1)) w l ti '600 turns, air&{r}',"
string="$string 'kocman_600_cold_ferr_2/part_0.j' u 1:(\$3*(-1)) w l ti '600 turns, ferr',"
# echo ${string%,*}
echo ${string%,*} | gnuplot
okular graf_2.pdf