60814c2433281c383ba64d6042d7aa831fe03221
[gnuplot] / demo / rgb_variable.dem
1 set border -1 front linetype -1 linewidth 1.000
2 set ticslevel 0
3 set xtics border
4 set ytics border
5 set ztics border
6 set xlabel "Red" tc rgb "red"
7 set xrange [0:255]
8 set ylabel "Green" tc rgb "green"
9 set yrange [0:255]
10 set zlabel "Blue" tc rgb "blue"
11 set zrange [0:255]
12 #
13 rgb(r,g,b) = int(r)*65536 + int(g)*256 + int(b)
14 #
15 splot 'rgb_variable.dat' using 1:2:3:(rgb($1,$2,$3)) with points pt 7 ps 4 lc rgb variable, \
16       '' using 1:2:3:(sprintf("0x%x",rgb($1,$2,$3))) with labels left offset 1 notitle
17 pause -1 "Hit return to continue"
18 #
19 #
20 # Unfortunately, not all platforms allow us to read hexadecimal constants
21 # from a data file. Warn the user if that is the case.
22 #
23 if (0 == int('0x01')) \
24    set label 99 at screen .05, screen .15 "If you see only black dots,\nthis means your platform does not \nsupport reading hexadecimal constants\nfrom a data file. Get a newer libc."
25
26 splot 'rgb_variable.dat' using 1:2:3:(5*rand(0)):4 with points pt 7 ps variable lc rgb variable \
27       title "variable pointsize and rgb color read as hexidecimal"
28
29 pause -1 "Hit return to continue"
30 set label 99 ""
31 #
32 set border 0
33 set xtics axis nomirror
34 set ytics axis nomirror
35 set ztics axis nomirror
36 set xzeroaxis lt -1 lc rgb "red" lw 2
37 set yzeroaxis lt -1 lc rgb "green" lw 2
38 set zzeroaxis lt -1 lc rgb "blue" lw 2
39 set xyplane at 0.0
40
41 splot 'rgb_variable.dat' using 1:2:3:(5*rand(0)):(rgb($1,$2,$3)) with points pt 7 ps variable lc rgb variable \
42       title "variable pointsize and rgb color computed from coords"
43 pause -1 "Hit return to continue"
44
45 set title "Demo of hidden3d with points only (no surface)"
46 set hidden3d
47 replot
48 pause -1 "Hit return to continue"
49 #
50 reset