aboutsummaryrefslogtreecommitdiff
path: root/plot_jerk.gnuplot
diff options
context:
space:
mode:
authorLibravatar Martin Michalec <martin@michalec.dev>2026-11-11 22:28:13 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-11-11 22:47:34 +0000
commitcb070b2d3f2b6e241e3be1b7e0eeb90fc755255f (patch)
treec7d90c0abe9533c87d51b5196871846855efa1ba /plot_jerk.gnuplot
downloadthesis-cb070b2d3f2b6e241e3be1b7e0eeb90fc755255f.tar.gz
publishHEADmaster
Diffstat (limited to 'plot_jerk.gnuplot')
-rw-r--r--plot_jerk.gnuplot49
1 files changed, 49 insertions, 0 deletions
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 @@
1# -*- Gnuplot -*-
2
3# Usage:
4# gnuplot -e "before='original.csv'; after='compensated.csv'; out='jerk.svg'" plot_jerk.gnuplot
5#
6# CSV columns expected from diagnostics.c:
7# 1 t, 11 j_abs, 14 is_work, 15 is_traverse
8
9if (!exists("before")) before = "original.csv"
10if (!exists("after")) after = "compensated.csv"
11if (!exists("out")) out = "res/jerk.tex"
12
13set encoding utf8
14set datafile separator comma
15set term cairolatex pdf input \
16 blacktext notransparent nocrop \
17 size 16.5cm,10cm \
18 noheader
19set output out
20
21set format y "\\text{%.0f}"
22set format x "\\text{%.0f}"
23set x2label "Время, $t$ (с)"
24set y2label "Рывок, $j$ (м/с$^\\text{3}$)" offset 1,0
25set grid
26set key center bmargin horizontal maxrows 2
27set key width -4
28set key samplen 1.5 # Shortens the little colored line sample
29set key spacing 1.2 # Adds slight vertical space between the two rows
30set key Left # Left-aligns the text descriptions
31set key reverse # Swaps the sample line and text position (Line comes AFTER text)
32
33# Цвет различает набор данных, тип линии различает тип участка:
34# сплошная — рабочий участок;
35# штриховая — нерабочий участок G0.
36set style line 1 lc rgb "#1f77b4" lw 1.7 dt 1
37set style line 2 lc rgb "#1f77b4" lw 1.7 dt 3
38set style line 3 lc rgb "#d62728" lw 1.7 dt 1
39set style line 4 lc rgb "#d62728" lw 1.7 dt 3
40
41set autoscale noextend
42set xrange [0:8]
43
44plot before every ::1 using 1:(column(14) > 0.5 ? column(11)/1000 : 1/0) with lines ls 1 title "Исходный, рабочие", \
45 before every ::1 using 1:(column(15) > 0.5 ? column(11)/1000 : 1/0) with lines ls 2 title "Исходный, холостые", \
46 after every ::1 using 1:(column(14) > 0.5 ? column(11)/1000 : 1/0) with lines ls 3 title "Уточнённый, рабочие", \
47 after every ::1 using 1:(column(15) > 0.5 ? column(11)/1000 : 1/0) with lines ls 4 title "Уточнённый, холостые"
48
49set output