File: varcolor.dem

package info (click to toggle)
gnuplot 6.0.2%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 14,936 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 (112 lines) | stat: -rw-r--r-- 4,473 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
104
105
106
107
108
109
110
111
112
#
# 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 fs solid fc 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 fs solid lc variable, \
     '' using 1:(-$2/2):1 with boxes fs solid fc 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 fc 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
set errorbars lw 1.0 lc black dt '-'
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 fc pal z fs solid, \
     '' using 1:(-$2/2):1 with boxes lc pal z

pause -1 'Hit <cr> to continue'

set errorbars
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 fs solid fc 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 fc rgb var fs solid, \
     '' using 1:(-$2/2):(rgbfudge($1)) with boxes fs solid fc 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'

set title "variable color using multiple named palettes"

set palette defined (0 "gray90", 1 "dark-blue")
set colormap new blues
set palette defined (0 "dark-red", 1 "yellow" )
set colormap new flame
set palette cubehelix
set colormap new ch
unset colorbox

set for [i=1:10] linetype i lw 2.0

plot 'candlesticks.dat' using 1:(1):1 with points pt 11 lc pal blues, \
     '' using 1:2:(.1):1 with circles lc pal flame, \
     '' using 1:3:2:6:5:1 with candlesticks lc pal ch, \
     '' using ($1+.3):3:2:6:5:1 with financebars lc pal blues, \
     '' using 1:(8):(by3($0)):(by4($0)):1 with boxxy lc pal flame fs solid, \
     '' using 1:(-$2/2):1 with boxes lc pal ch

pause -1 'Hit <cr> to continue'

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

pause -1 'Hit <cr> to continue'

reset