File: varcolor.dem

package info (click to toggle)
gnuplot 5.0.5%2Bdfsg1-6%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 12,800 kB
  • ctags: 8,062
  • sloc: ansic: 78,152; cpp: 6,981; makefile: 2,075; sh: 1,343; lisp: 655; perl: 302; awk: 235; pascal: 194; tcl: 88; python: 46
file content (77 lines) | stat: -rw-r--r-- 3,198 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#
# Demo/test of variable color in many different plot styles
#
set boxwidth 0.2 abs
set bars front
by3(x) = (((int(x)%3)+1)/6.)
by4(x) = (((int(x)%4)+1)/7.)
rgbfudge(x) = x*51*32768 + (11-x)*51*128 + int(abs(5.5-x)*510/9.)

set yrange [-4:10]
set xrange [0:11]
unset key #below 

set title "variable color points, circles, candlesticks, boxes, and boxxyerror"
plot 'candlesticks.dat' using 1:(1):1 with points pt 11 lc variable, \
     '' using 1:2:(.1):1 with circles lc variable, \
     '' using 1:3:2:6:5:1 with candlesticks lc variable, \
     '' using ($1+.3):3:2:6:5:1 with financebars lc variable, \
     '' using 1:(8):(by3($0)):(by4($0)):1 with boxxy lc var fs solid, \
     '' using 1:(-$2/2):1 with boxes lc var

pause -1 'Hit <cr> to continue'

set title "variable color boxerror, xyerrorbars, impulses, vectors, and labels"
unset colorbox
plot 'candlesticks.dat' \
        using 1:5:2:6:(.2):1 with boxerror lc var fs solid 0.5 border -1 , \
     '' using 1:(1):1 with points pt 11 lc variable, \
     '' using 1:(8):(by3($0)):(by4($0)):1 with xyerrorbars lc var, \
     '' using ($1+.5):($2/2):1 with impulses lc var lw 3,\
     '' using 1:(-3):(0.5):(1):1 with vectors lc var,\
     '' using 1:(-1):1:1 with labels tc variable

pause -1 'Hit <cr> to continue'

set title "variable color using 'lc palette z'"
set colorbox
plot 'candlesticks.dat' using 1:(1):1 with points pt 11 lc pal z, \
     '' using 1:2:(.1):1 with circles lc pal z, \
     '' using 1:3:2:6:5:1 with candlesticks lc pal z, \
     '' using ($1+.3):3:2:6:5:1 with financebars lc pal z, \
     '' using 1:(8):(by3($0)):(by4($0)):1 with boxxy lc pal z fs solid, \
     '' using 1:(-$2/2):1 with boxes lc pal z

pause -1 'Hit <cr> to continue'

plot 'candlesticks.dat' \
        using 1:5:2:6:(.2):1 with boxerror lc pal z fs solid 0.5, \
     '' using 1:(1):1 with points pt 11 lc pal z, \
     '' using 1:(8):(by3($0)):(by4($0)):1 with xyerrorbars lc pal z, \
     '' using ($1+.5):($2/2):1 with impulses lc pal z lw 3,\
     '' using 1:(-3):(0.5):(1):1 with vectors lc pal z,\
     '' using 1:(-1):1:1 with labels tc pal z


pause -1 'Hit <cr> to continue'

set title "variable color using 'lc rgb variable'"
plot 'candlesticks.dat' using 1:(1):(rgbfudge($1)) with points pt 11 lc rgb var, \
     '' using 1:2:(.1):(rgbfudge($1)) with circles lc rgb var, \
     '' using 1:3:2:6:5:(rgbfudge($1)) with candlesticks lc rgb var, \
     '' using ($1+.3):3:2:6:5:(rgbfudge($1)) with financebars lc rgb var, \
     '' using 1:(8):(by3($0)):(by4($0)):(rgbfudge($1)) with boxxy lc rgb var fs solid, \
     '' using 1:(-$2/2):(rgbfudge($1)) with boxes lc rgb var

pause -1 'Hit <cr> to continue'

plot 'candlesticks.dat' \
        using 1:5:2:6:(.2):(rgbfudge($1)) with boxerror lc rgb var fs solid 0.5 noborder, \
     '' using 1:(1):(rgbfudge($1)) with points pt 11 lc rgb var, \
     '' using 1:(8):(by3($0)):(by4($0)):(rgbfudge($1)) with xyerrorbars lc rgb var, \
     '' using ($1+.5):($2/2):(rgbfudge($1)) with impulses lc rgb var lw 3,\
     '' using 1:(-3):(0.5):(1):(rgbfudge($1)) with vectors lc rgb var,\
     '' using 1:(-1):1:(rgbfudge($1)) with labels tc rgb var point

pause -1 'Hit <cr> to continue'
reset