aboutsummaryrefslogtreecommitdiff
path: root/plot_speed_error_points.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_points.gnuplot
downloadthesis-cb070b2d3f2b6e241e3be1b7e0eeb90fc755255f.tar.gz
publishHEADmaster
Diffstat (limited to 'plot_speed_error_points.gnuplot')
-rw-r--r--plot_speed_error_points.gnuplot40
1 files changed, 40 insertions, 0 deletions
diff --git a/plot_speed_error_points.gnuplot b/plot_speed_error_points.gnuplot
new file mode 100644
index 0000000..d3d9d96
--- /dev/null
+++ b/plot_speed_error_points.gnuplot
@@ -0,0 +1,40 @@
1# Usage:
2# gnuplot -e "before='original.csv'; after='compensated.csv'; out='speed_error.svg'" plot_speed_error_points.gnuplot
3#
4# CSV columns expected from diagnostics.c:
5# 1 t, 9 v_err_abs, 14 is_work, 15 is_traverse
6
7if (!exists("before")) before = "original.csv"
8if (!exists("after")) after = "compensated.csv"
9if (!exists("out")) out = "speed_error.svg"
10
11set encoding utf8
12set datafile separator comma
13set terminal svg size 1400,700 dynamic enhanced dashed font "DejaVu Sans,12"
14set output out
15
16set title "Ошибка скорости до и после компенсации"
17set xlabel "t, с"
18set ylabel "|e_v|, мм/с"
19set grid
20set key outside right center
21
22# Цвет различает набор данных:
23# синий — до компенсации;
24# красный — после компенсации.
25# Тип точки различает тип участка:
26# круглая точка — рабочий участок;
27# крестик — нерабочий участок G0.
28set style line 1 lc rgb "#1f77b4" pt 7 ps 0.25
29set style line 2 lc rgb "#1f77b4" pt 2 ps 0.30
30set style line 3 lc rgb "#d62728" pt 7 ps 0.25
31set style line 4 lc rgb "#d62728" pt 2 ps 0.30
32
33set xrange [0:10]
34
35plot before every ::1 using 1:(column(14) > 0.5 ? column(9) : 1/0) with points ls 1 title "до, рабочие", \
36 before every ::1 using 1:(column(15) > 0.5 ? column(9) : 1/0) with points ls 2 title "до, G0", \
37 after every ::1 using 1:(column(14) > 0.5 ? column(9) : 1/0) with points ls 3 title "после, рабочие", \
38 after every ::1 using 1:(column(15) > 0.5 ? column(9) : 1/0) with points ls 4 title "после, G0"
39
40set output