File: chi_shapes.dem

package info (click to toggle)
gnuplot 6.0.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,940 kB
  • sloc: ansic: 95,319; cpp: 7,590; makefile: 2,470; javascript: 2,328; sh: 1,531; lisp: 664; perl: 304; pascal: 191; tcl: 88; python: 46
file content (45 lines) | stat: -rw-r--r-- 1,808 bytes parent folder | download | duplicates (3)
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
#
# Illustrate effect of chi_length on construction of concave hull
#
# Appropriate choice of `chi_length` depends strongly on the density and
# distribution of the input data points.
# Too-large values of chi_length will yield the convex hull.
# Too-small values of chi_length will make the chi-shape very 'spikey'.
# If no value for `chi_length` has set, gnuplot will choose one automatically
# but there is no guarantee that this value is suitable for your data.
# For the data used here gnuplot would choose chi_length=22.6 by default,
# which is 0.6 of the length of the longest edge in the convex hull.
#
if (!strstrt(GPVAL_COMPILE_OPTIONS, "+CHI_SHAPES")) {
    print "Your copy of gnuplot was not built with support for chi shapes"
} else {
    unset key
    unset tics; unset border
    set offsets graph 0, 0, graph 0.1, graph 0.1
    set style line 2 lc "forest-green" pt 7 ps 0.5
    set style fill transparent solid 0.1 noborder
    set xrange [-30:30]
    set yrange [-30:30]

    set title noenhanced offset 0, -2.0

    set multiplot layout 2,2 spacing 0 margins 0, 1, 0, 0.9 \
	title "concave hull smooth path expand 3.0    " font ":Bold"
    chi_length = real("+Inf")
    set title "chi_length = +Inf  (convex hull)"
    plot 'hull.dat' index 0 with points ls 2 notitle, \
	 '' index 0 concavehull with polygons fs empty border lc "black", \
	 '' index 0 concavehull smooth path expand 3.00 with filledcurve ls 2 \
		    title sprintf("chi_length = %.1f", GPVAL_CHI_LENGTH)
    chi_length = 25.; set title sprintf("chi_length = %.1f", chi_length)
    replot
    chi_length = 20.; set title sprintf("chi_length = %.1f", chi_length)
    replot
    chi_length = 16.; set title sprintf("chi_length = %.1f", chi_length)
    replot
    unset multiplot
}

pause -1 "Hit return to continue"

reset