Debian Codegraph @

demos/scripts/graph5.tcl

raw
1
2 set configOptions {
3 Element.LineWidth 0
4 Element.Pixels 0.7c
5 Element.ScaleSymbols true
6 Font { Courier 18 bold}
7 Height 4i
8 Legend.ActiveRelief raised
9 Legend.Font { Courier 14 }
10 Legend.padY 0
11 Title "Element Symbol Types"
12 Width 5i
13 }
14 set resName [string trimleft $graph .]
15 foreach { option value } $configOptions {
16 option add *$resName.$option $value
17 }
18
19 vector create xValues
20 xValues set {
21 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
22 }
23
24 for { set i 0 } { $i < 10 } { incr i } {
25 set vecName "y${i}"
26 vector create ${vecName}(10)
27 $vecName variable x
28 set x(:) [expr $i*50.0+10.0]
29 }
30
31 set attributes {
32 none "None" red red4 y0
33 circle "Circle" yellow yellow4 y2
34 cross "Cross" cyan cyan4 y6
35 diamond "Diamond" green green4 y3
36 plus "Plus" magenta magenta4 y9
37 splus "Splus" Purple purple4 y7
38 scross "Scross" red red4 y8
39 square "Square" orange orange4 y1
40 triangle "Triangle" blue blue4 y4
41 "@bitmaps/hobbes.xbm @bitmaps/hobbes_mask.xbm"
42 "Bitmap" yellow black y5
43 }
44
45 set count 0
46 foreach { symbol label fill color yVec } $attributes {
47 $graph element create line${count} \
48 -label $label \
49 -symbol $symbol \
50 -color $color \
51 -fill $fill \
52 -x xValues \
53 -y $yVec
54 incr count
55 }
56 $graph element configure line0 \
57 -dashes { 2 4 2 } \
58 -linewidth 2
59
60 Blt_ZoomStack $graph
61 Blt_Crosshairs $graph
62 Blt_ActiveLegend $graph
63 Blt_ClosestPoint $graph
64 Blt_PrintKey $graph
65