File: macros.dem

package info (click to toggle)
gnuplot5 5.0.0~rc%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 11,548 kB
  • ctags: 8,104
  • sloc: ansic: 77,108; cpp: 6,848; makefile: 1,932; sh: 1,343; lisp: 657; perl: 302; awk: 235; pascal: 194; tcl: 88; python: 46
file content (34 lines) | stat: -rw-r--r-- 736 bytes parent folder | download | duplicates (11)
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
#
# Exercise use of macro substitution
#
set macros

title = "Test of command line macro substitution"
style1 = "points"
style2 = "lines lw 2"
plot1 = "'1.dat' using 1:2 with @style1"
plot2 = "'1.dat' using 1:($2+1) with @style2"
plot3 = '@plot2'
plot4 = '@plot3'
plot5 = '@plot4'
plot6 = '@plot5'
#
set title title
plot @plot1 title 'plot1', \
     @plot2 title 'plot2'
show var
#
pause -1 "<cr> to test limit on recursion depth"
#
print "testing depth 3"
plot @plot1 title 'plot1', @plot3 lt 3 title 'Recursion depth 3'
pause 1
print "testing depth 4"
plot @plot1 title 'plot1', @plot4 lt 4 title 'Recursion depth 4'
pause 1
print "testing depth 5"
plot @plot1 title 'plot1', @plot5 lt 5 title 'Recursion depth 5'
pause 1
#
pause -1