File: macros.dem

package info (click to toggle)
gnuplot 6.0.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,940 kB
  • sloc: ansic: 95,319; cpp: 7,590; makefile: 2,470; javascript: 2,328; sh: 1,531; lisp: 664; 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