From cb070b2d3f2b6e241e3be1b7e0eeb90fc755255f Mon Sep 17 00:00:00 2001 From: Martin Michalec Date: Thu, 12 Nov 2026 01:28:13 +0300 Subject: publish --- plot_speed_error.gnuplot | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 plot_speed_error.gnuplot (limited to 'plot_speed_error.gnuplot') diff --git a/plot_speed_error.gnuplot b/plot_speed_error.gnuplot new file mode 100644 index 0000000..28932c8 --- /dev/null +++ b/plot_speed_error.gnuplot @@ -0,0 +1,51 @@ +# -*- 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 -- cgit v1.3.1