Sandbox/gnuplot/BaseDiagn/plot.sh

#!/bin/bash

ShotNo=18572

XKEY="11.5"


OUT="basic_diagn"
plot="set bmargin 0;set tmargin 1;set lmargin 10;set rmargin 3;unset xtics;unset xlabel;set multiplot layout 5, 1 title 'GOLEM Shot \#$ShotNo';set xrange [12.5:21.5];set yrange [*:*];set style data dots"

plot="$plot;set format y '%.0f';set ytics 5;set key at $XKEY, 29;set ylabel '\$U_l\$ [V]' offset -2;set yrange [0.:13];plot '< wget -q -O - http://golem.fjfi.cvut.cz/utils/data/$ShotNo/loop_voltage' u (\$1*1000):(\$2) w l lw 4 lc rgb '#0000aa' title ''; unset title;set tmargin 0;"
plot="$plot;set format y '%.1f';set yrange [-0.01:0.4];set key at $XKEY, 0.3;set ytics 0.1;set ylabel '\$B_t\$ [T]' offset 0;plot '< wget -q -O - http://golem.fjfi.cvut.cz/utils/data/$ShotNo/toroidal_field' u (\$1*1000):(\$2) w l lw 4 lc rgb '#0000aa' title '';"
plot="$plot;set format y '%.1f';set yrange [-0.1:1.5];set key at $XKEY, 4.1;set ytics 0.4;set ylabel '\$I_p\$ [kA]' offset -1;plot '< wget -q -O - http://golem.fjfi.cvut.cz/utils/data/$ShotNo/plasma_current' u (\$1*1000):(\$2/1000) w l lw 4 lc rgb '#0000aa' title '';"
plot="$plot;set xtics;set xlabel 't [ms]';"
plot="$plot;set format y '%.2f';set yrange [-0.006:0.4];set key at $XKEY, 0.205;set format x '%.0f';set ytics 0.1;set ylabel '\$I_{rad}\$ [a.u.]' offset 0;plot '< wget -q -O - http://golem.fjfi.cvut.cz/utils/data/$ShotNo/photodiode_alpha' u (\$1*1000):(\$2) w l lw 4 lc rgb '#00aa88' title '','< wget -q -O - http://golem.fjfi.cvut.cz/utils/data/$ShotNo/photodiode' u (\$1*1000):(\$2) w l lw 4 lc rgb '#0000aa' title '',;"

echo $plot | gnuplot --persist
echo "set terminal epslatex size 15cm,12cm color colortext standalone;set output 'fig.tex';"$plot|gnuplot ;pdflatex fig.tex
convert -density 300 fig.pdf fig.jpg