diff options
Diffstat (limited to 'plot_jerk.gnuplot')
| -rw-r--r-- | plot_jerk.gnuplot | 49 |
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 | |||
| 9 | if (!exists("before")) before = "original.csv" | ||
| 10 | if (!exists("after")) after = "compensated.csv" | ||
| 11 | if (!exists("out")) out = "res/jerk.tex" | ||
| 12 | |||
| 13 | set encoding utf8 | ||
| 14 | set datafile separator comma | ||
| 15 | set term cairolatex pdf input \ | ||
| 16 | blacktext notransparent nocrop \ | ||
| 17 | size 16.5cm,10cm \ | ||
| 18 | noheader | ||
| 19 | set output out | ||
| 20 | |||
| 21 | set format y "\\text{%.0f}" | ||
| 22 | set format x "\\text{%.0f}" | ||
| 23 | set x2label "Время, $t$ (с)" | ||
| 24 | set y2label "Рывок, $j$ (м/с$^\\text{3}$)" offset 1,0 | ||
| 25 | set grid | ||
| 26 | set key center bmargin horizontal maxrows 2 | ||
| 27 | set key width -4 | ||
| 28 | set key samplen 1.5 # Shortens the little colored line sample | ||
| 29 | set key spacing 1.2 # Adds slight vertical space between the two rows | ||
| 30 | set key Left # Left-aligns the text descriptions | ||
| 31 | set key reverse # Swaps the sample line and text position (Line comes AFTER text) | ||
| 32 | |||
| 33 | # Цвет различает набор данных, тип линии различает тип участка: | ||
| 34 | # сплошная — рабочий участок; | ||
| 35 | # штриховая — нерабочий участок G0. | ||
| 36 | set style line 1 lc rgb "#1f77b4" lw 1.7 dt 1 | ||
| 37 | set style line 2 lc rgb "#1f77b4" lw 1.7 dt 3 | ||
| 38 | set style line 3 lc rgb "#d62728" lw 1.7 dt 1 | ||
| 39 | set style line 4 lc rgb "#d62728" lw 1.7 dt 3 | ||
| 40 | |||
| 41 | set autoscale noextend | ||
| 42 | set xrange [0:8] | ||
| 43 | |||
| 44 | plot 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 | |||
| 49 | set output | ||
