From cb070b2d3f2b6e241e3be1b7e0eeb90fc755255f Mon Sep 17 00:00:00 2001 From: Martin Michalec Date: Thu, 12 Nov 2026 01:28:13 +0300 Subject: publish --- plot_jerk.gnuplot | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 plot_jerk.gnuplot (limited to 'plot_jerk.gnuplot') diff --git a/plot_jerk.gnuplot b/plot_jerk.gnuplot new file mode 100644 index 0000000..f09e970 --- /dev/null +++ b/plot_jerk.gnuplot @@ -0,0 +1,49 @@ +# -*- Gnuplot -*- + +# Usage: +# gnuplot -e "before='original.csv'; after='compensated.csv'; out='jerk.svg'" plot_jerk.gnuplot +# +# CSV columns expected from diagnostics.c: +# 1 t, 11 j_abs, 14 is_work, 15 is_traverse + +if (!exists("before")) before = "original.csv" +if (!exists("after")) after = "compensated.csv" +if (!exists("out")) out = "res/jerk.tex" + +set encoding utf8 +set datafile separator comma +set term cairolatex pdf input \ + blacktext notransparent nocrop \ + size 16.5cm,10cm \ + noheader +set output out + +set format y "\\text{%.0f}" +set format x "\\text{%.0f}" +set x2label "Время, $t$ (с)" +set y2label "Рывок, $j$ (м/с$^\\text{3}$)" offset 1,0 +set grid +set key center bmargin horizontal maxrows 2 +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 2 lc rgb "#1f77b4" lw 1.7 dt 3 +set style line 3 lc rgb "#d62728" lw 1.7 dt 1 +set style line 4 lc rgb "#d62728" lw 1.7 dt 3 + +set autoscale noextend +set xrange [0:8] + +plot before every ::1 using 1:(column(14) > 0.5 ? column(11)/1000 : 1/0) with lines ls 1 title "Исходный, рабочие", \ + before every ::1 using 1:(column(15) > 0.5 ? column(11)/1000 : 1/0) with lines ls 2 title "Исходный, холостые", \ + after every ::1 using 1:(column(14) > 0.5 ? column(11)/1000 : 1/0) with lines ls 3 title "Уточнённый, рабочие", \ + after every ::1 using 1:(column(15) > 0.5 ? column(11)/1000 : 1/0) with lines ls 4 title "Уточнённый, холостые" + +set output -- cgit v1.3.1