# -*- Gnuplot -*- # Usage: # gnuplot -e "before='original.csv'; after='compensated.csv'; out='speed_error.svg'" plot_speed_error.gnuplot # # CSV columns expected from diagnostics.c: # 1 t, 9 v_err_abs, 14 is_work, 15 is_traverse if (!exists("before")) before = "original.csv" if (!exists("after")) after = "compensated.csv" if (!exists("out")) out = "res/speed_error.tex" set encoding utf8 set datafile separator comma set term cairolatex pdf input \ blacktext notransparent nocrop \ size 16.5cm,10.25cm \ noheader set output out # set size ratio 0.66 # set lmargin at screen 0.1 # set rmargin at screen 0.9 # set bmargin at screen 0.1 # set tmargin at screen 0.9 set format y "\\text{%.0f}" set format x "\\text{%.0f}" set x2label "Время, $t$ (с)" set y2label "Ошибка скорости, $|e_v|$ (мм/с)" offset 1,0 set grid set key center bmargin horizontal maxrows 1 set key width -4 set key samplen 1.5 # Shortens the little colored line sample set key spacing 1.2 # Adds slight vertical space between the two rows set key Left # Left-aligns the text descriptions set key reverse # Swaps the sample line and text position (Line comes AFTER text) # Цвет различает набор данных, тип линии различает тип участка: # сплошная — рабочий участок; # штриховая — нерабочий участок G0. set style line 1 lc rgb "#1f77b4" lw 1.7 dt 1 set style line 3 lc rgb "#d62728" lw 2 dt 1 set yrange [-5:55] set xrange [0:8] plot before every ::1 using 1:9 with lines ls 1 title "Исходный", \ after every ::1 using 1:9 with lines ls 3 title "Уточнённый" set output