File: imageNaN.dem

package info (click to toggle)
gnuplot5 5.0.0~rc%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 11,548 kB
  • ctags: 8,104
  • sloc: ansic: 77,108; cpp: 6,848; makefile: 1,932; sh: 1,343; lisp: 657; perl: 302; awk: 235; pascal: 194; tcl: 88; python: 46
file content (103 lines) | stat: -rw-r--r-- 1,799 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#
# Explore the effect of image data pixels that are
# missing/NaN/Inf/garbage/...
# Test 2D and 3D versions of the generic and
# terminal-optimized image code.
# The four tests should all come out the same.
#

set title "Treatment of missing/undefined/NaN/Inf data"
unset key
set tic scale 0
set border 3 front

set cbrange [-2:7]
set cblabel "Score"
set cbtics 0,1,5

set xrange [-0.5:5.5]
set yrange [-0.5:5.5]

set datafile missing "?"
set ytics ("-Inf" 5, "Inf" 4, "NaN" 3, "Junk" 2, "?" 1, "0" 0)
set xtics 0

# Define the test data as a named data block
$matrixdata << EOD
0    5 4 3 1 0
?    2 2 0 0 1
Junk 1 2 3 4 5
NaN  0 0 3 1 0
Inf  3 2 0 2 3
-Inf 0 1 2 4 3
EOD

set xlabel "First column contains various odd values" offset 0,1

set view map
plot $matrixdata matrix with image 

pause -1 "Hit return to continue"
#
#
set title "Same thing in failsafe mode (2D)"

plot $matrixdata matrix with image failsafe

pause -1 "Hit return to continue"

set title "Same thing passing data value through 'using 1:2:($3)'"

plot $matrixdata matrix using 1:2:($3) with image failsafe

pause -1 "Hit return to continue"

set title "Same thing in 3D mode"

splot $matrixdata matrix with image

pause -1 "Hit return to continue"

set title "Same thing in failsafe mode (3D)"

splot $matrixdata matrix with image failsafe

pause -1 "Hit return to continue"

set title "3D image with pixel value in 4th column"

splot $matrixdata matrix using 1:2:(0):3 with image

pause -1 "Hit return to continue"

reset

$DATA << EOD
0	0	0
0	1	-1
0	2	-4
0	3	-9

1	0	1
1	1	0
1	2	-3
1	3	-8

2	0	4
2	1	3
2	2	0
2	3	-5

3	0	9
3	1	8
3	2	NaN
3	3	9

EOD

set title "image from non-matrix data"
set termopt enhanced
set label 1 at 3,2 "NaN pixel \nshould appear as\nbackground" front center
plot $DATA with image 
pause -1
reset