Initial release of Maemo 5 port of gnuplot
[gnuplot] / demo / macros.dem
1 #
2 # Experimental option GP_MACROS
3 #
4
5 if ((GPVAL_VERSION == 4.1 || GPVAL_VERSION == 4.2) \
6 &&  (!strstrt(GPVAL_COMPILE_OPTIONS,"+MACROS"))) \
7     print ">>> Skipping demo <<<\n" ; \
8     print "This copy of gnuplot was built without support for macro substitution\n" ; \
9     exit ;
10
11 set macros
12 title = "Test of command line macro substitution"
13 style1 = "points"
14 style2 = "lines lw 2"
15 plot1 = "'1.dat' using 1:2 with @style1"
16 plot2 = "'1.dat' using 1:($2+1) with @style2"
17 plot3 = '@plot2'
18 plot4 = '@plot3'
19 plot5 = '@plot4'
20 plot6 = '@plot5'
21 #
22 set title title
23 plot @plot1 title 'plot1', \
24      @plot2 title 'plot2'
25 show var
26 #
27 pause -1 "<cr> to test recursion depth"
28 #
29 plot @plot1 title 'plot1', @plot3 lt 3 title 'Recursion depth 3'
30 pause 1
31 plot @plot1 title 'plot1', @plot4 lt 4 title 'Recursion depth 4'
32 pause 1
33 plot @plot1 title 'plot1', @plot5 lt 5 title 'Recursion depth 5'
34 pause 1
35 plot @plot1 title 'plot1', @plot6 lt 6 title 'Recursion depth 6'
36 pause 1
37 #
38 pause -1
39