#!/bin/bash

DPATH=/golem/GW/Experiments/EdgePlasmaPhysics/ParticleFlux/RakeProbe/1114ShotToShotMeasurement
BASE="set font 'Times Bold,12';set bmargin 0;set tmargin 0;set lmargin 10;set rmargin 3;unset xtics;unset xlabel;set multiplot layout 3, 1;set xrange [16:25];set yrange [0:1.5];set style data dots;set ylabel 'I_{p} [kA]';unset xtics;plot '< wget -q -O - http://golem.fjfi.cvut.cz/utils/data/17743/plasma_current' u ("'$1*1000'"):("'$2/1000'") w l lw 2 lc 1 title '#17743: I_{p}=';set bmargin at screen 0.15;set xtics;set key right bottom;set xlabel 't [ms]';set ylabel 'I_{LP} [mA]';set label 1 'Ion saturation current' at 18,-10 textcolor lt 1;set label 2 'Electron current' at 21.5,-100 textcolor lt 3;set yrange [-200:30];plot '$DPATH/Sessions/1114Intro/Analysis/Data/17739v_r' u ("'$1*1000'"):("'$2/50*1000'") w l lw 2 lc 1 title '#17739: V_{bias}=-40V','$DPATH/Sessions/1114Intro/Analysis/Data/17762v_r' u ("'$1*1000'"):("'$2/50*1000'") w l lw 2 lc 3 title '#17762: V_{bias}=+14V'"



echo "$BASE"|gnuplot -persist;\
echo "set terminal postscript enhanced color portrait size 30,18 font 'Times Bold,50';$BASE"|gnuplot > graph.eps; convert graph.eps graph.jpg

	