2 # Demonstrate use of pm3d palette colors for 2D plots
3 # terminal-independent color choices
7 set title "Terminal-independent RGB colors in 2D"
8 set xlabel "Implemented using built-in rgb color names\n(only works for terminals that can do full rgb color)"
16 # define line styles using explicit rgbcolor names
18 set style line 1 lt rgb "red" lw 3
19 set style line 2 lt rgb "orange" lw 2
20 set style line 3 lt rgb "yellow" lw 3
21 set style line 4 lt rgb "green" lw 2
22 set style line 5 lt rgb "cyan" lw 3
23 set style line 6 lt rgb "blue" lw 2
24 set style line 7 lt rgb "violet" lw 3
26 set label 1 'set style line 1 lt rgb "red" lw 3' at -0.4, -0.25 tc rgb "red"
27 set label 2 'set style line 2 lt rgb "orange" lw 2' at -0.4, -0.35 tc rgb "orange"
28 set label 3 'set style line 3 lt rgb "yellow" lw 3' at -0.4, -0.45 tc rgb "yellow"
29 set label 4 'set style line 4 lt rgb "green" lw 2' at -0.4, -0.55 tc rgb "green"
30 set label 5 'set style line 5 lt rgb "cyan" lw 3' at -0.4, -0.65 tc rgb "cyan"
31 set label 6 'set style line 6 lt rgb "blue" lw 2' at -0.4, -0.75 tc rgb "blue"
32 set label 7 'set style line 7 lt rgb "violet" lw 3' at -0.4, -0.85 tc rgb "violet"
35 print '# These are the input commands'
37 print ' set style line 1 lt rgb "red" lw 3'
38 print ' set style line 2 lt rgb "orange" lw 2'
39 print ' set style line 3 lt rgb "yellow" lw 3'
40 print ' set style line 4 lt rgb "green" lw 2'
41 print ' set style line 5 lt rgb "cyan" lw 3'
42 print ' set style line 6 lt rgb "blue" lw 2'
43 print ' set style line 7 lt rgb "violet" lw 3'
45 print '# And this is the result'
51 plot cos(x) ls 1 title 'red', \
52 cos(x-.2) ls 2 title 'orange',\
53 cos(x-.4) ls 3 title 'yellow',\
54 cos(x-.6) ls 4 title 'green', \
55 cos(x-.8) ls 5 title 'cyan', \
56 cos(x-1.) ls 6 title 'blue', \
57 cos(x-1.2) ls 7 title 'violet'
59 pause -1 "Hit return to continue"
61 if ((GPVAL_VERSION == 4.1 || GPVAL_VERSION == 4.2) \
62 && (!strstrt(GPVAL_COMPILE_OPTIONS,"+MACROS"))) \
63 print ">>> Skipping demo <<<\n" ; \
64 print "This copy of gnuplot was built without support for macro substitution\n" ; \
68 set title "Terminal-independent palette colors in 2D\nImplemented using command line macros referring to a fixed HSV palette"
69 set colorbox horizontal user origin .1,.08 size .8,.05
70 set xlabel 'HSV color wheel'
80 # Load terminal-independent colorwheel (HSV full saturation)
84 # define line styles using macros and a fixed palette
86 set style line 1 @red lw 3
87 set style line 2 @orange lw 2
88 set style line 3 @yellow lw 3
89 set style line 4 @green lw 2
90 set style line 5 @cyan lw 3
91 set style line 6 @blue lw 2
92 set style line 7 @violet lw 3
96 pause -1 "Hit return to continue"