aboutsummaryrefslogtreecommitdiff
path: root/plot_speed_error.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_speed_error.gnuplot
downloadthesis-cb070b2d3f2b6e241e3be1b7e0eeb90fc755255f.tar.gz
publishHEADmaster
Diffstat (limited to 'plot_speed_error.gnuplot')
-rw-r--r--plot_speed_error.gnuplot51
1 files changed, 51 insertions, 0 deletions
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 @@
1# -*- Gnuplot -*-
2
3# Usage:
4# gnuplot -e "before='original.csv'; after='compensated.csv'; out='speed_error.svg'" plot_speed_error.gnuplot
5#
6# CSV columns expected from diagnostics.c:
7# 1 t, 9 v_err_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/speed_error.tex"
12
13set encoding utf8
14set datafile separator comma
15set term cairolatex pdf input \
16 blacktext notransparent nocrop \
17 size 16.5cm,10.25cm \
18 noheader
19set output out
20
21# set size ratio 0.66
22# set lmargin at screen 0.1
23# set rmargin at screen 0.9
24# set bmargin at screen 0.1
25# set tmargin at screen 0.9
26
27set format y "\\text{%.0f}"
28set format x "\\text{%.0f}"
29set x2label "Время, $t$ (с)"
30set y2label "Ошибка скорости, $|e_v|$ (мм/с)" offset 1,0
31set grid
32set key center bmargin horizontal maxrows 1
33set key width -4
34set key samplen 1.5 # Shortens the little colored line sample
35set key spacing 1.2 # Adds slight vertical space between the two rows
36set key Left # Left-aligns the text descriptions
37set key reverse # Swaps the sample line and text position (Line comes AFTER text)
38
39# Цвет различает набор данных, тип линии различает тип участка:
40# сплошная — рабочий участок;
41# штриховая — нерабочий участок G0.
42set style line 1 lc rgb "#1f77b4" lw 1.7 dt 1
43set style line 3 lc rgb "#d62728" lw 2 dt 1
44
45set yrange [-5:55]
46set xrange [0:8]
47
48plot before every ::1 using 1:9 with lines ls 1 title "Исходный", \
49 after every ::1 using 1:9 with lines ls 3 title "Уточнённый"
50
51set output