-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTreePlotArray.hoc
59 lines (52 loc) · 1.25 KB
/
TreePlotArray.hoc
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
if (name_declared("pkgversions") != 4 ) { execute("strdef pkgversions") }
sprint(pkgversions,"%sTreePlot = $Revision: 1.5 $, ",pkgversions)
load_file("TreePlot.hoc")
load_file("RPlot.hoc")
begintemplate TreePlotArray
public glist, cellref
public rprintfile, rp
objref vb
objref hblist
objref glist
objref rp
// TreePlotArray(double rows, double cols)
proc init() { local i, j
rows = $1
cols = $2
vb = new VBox()
hblist = new List()
glist = new List()
vb.intercept(1)
for i=0,rows-1 {
hblist.append(new HBox())
hblist.object(i).intercept(1)
for j = 0,cols-1 {
glist.append(new TreePlot())
}
hblist.object(i).intercept(0)
hblist.object(i).map
}
vb.intercept(0)
vb.map
rp = new RPlot()
}
proc cellref() {
$o1 = glist.object($2*cols + $3)
}
// rprintfile(String epsfilename, Double SaveFile)
proc rprintfile() { local i, j
if (numarg() == 1) { rp.create_rfile() }
if (numarg() == 2) {
if ($2 != 0) { rp.create_rfile($s1) }
}
rp.start_plot($s1)
rp.set_mfrow(rows,cols)
for i=0,rows-1 {
for j = 0,cols-1 {
rp.add_graph(glist.object(i*cols+j))
}
}
rp.end_plot()
rp.run()
}
endtemplate TreePlotArray