File: v21-gm2gpl-plot_one_test.gpl

package info (click to toggle)
gnumed-server 22.31-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 46,268 kB
  • sloc: sql: 1,217,633; python: 15,878; sh: 1,590; makefile: 20
file content (59 lines) | stat: -rw-r--r-- 1,577 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#----------------------------------------------------
# GNUmed gnuplot graphing script example:
#
# plot one test result type very space efficient
#----------------------------------------------------

# uncomment for debugging:
#gm2gpl_datafile = './x-data.txt'


# general
#set title "your special title for this template"
set grid xtics noytics
set autoscale
set datafile missing '<?>'
set key off
set key tmargin center horizontal Left autotitle columnheader
set bmargin 7


# x axis
set xtics rotate by -45
set xdata time
set timefmt "%Y-%m-%d_%H:%M"


# plot
plot gm2gpl_datafile using 1:2:(valid(4) ? column(4) : column(2)):(valid(5) ? column(5) : column(2)):xticlabels(10) index 0 with yerrorbars pointtype 2, \
     gm2gpl_datafile using 1:2:(sprintf("%s%s", stringcolumn(2), stringcolumn(3))) index 0 notitle with labels offset 0, 1


# detect and adjust x range by 10% of entire time span
time_span = GPVAL_X_MAX - GPVAL_X_MIN
range_offset = time_span * 10 / 100
set xrange [(GPVAL_X_MIN - range_offset):(GPVAL_X_MAX + range_offset)]


# detect and adjust y range by 5%
five_percent = abs(GPVAL_Y_MIN * 5 / 100)
loffset = (GPVAL_Y_MIN == 0) ? 1 : five_percent
hoffset = (GPVAL_Y_MAX == 0) ? 1 : five_percent
set yrange [(GPVAL_Y_MIN - loffset):(GPVAL_Y_MAX + hoffset)]


# redraw with adjusted ranges
replot

# comment out for debugging
exit

# .png output:
set terminal png enhanced transparent nointerlace truecolor #medium #crop
set output "./gnumed-lab.png"
replot

# ASCII art output:
set terminal dumb size 120,40 enhanced
set output "./gnumed-lab.txt"
replot