File: macros.dem

package info (click to toggle)
gnuplot 5.4.1%2Bdfsg1-1%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,316 kB
  • sloc: ansic: 85,877; cpp: 7,440; makefile: 2,548; javascript: 2,322; sh: 1,542; lisp: 667; perl: 304; pascal: 191; 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