5 set gnuPlotstream
[open
{| gnuplot
} r
+]
9 puts stdout
$com ; flush stdout
10 puts
$gnuPlotstream $com ; flush
$gnuPlotstream
13 while {[gets stdin line
] >= 0} {
21 .text configure
-height 4 -width 40
24 # unlink gnu-optionsxx
27 sendgnu
"save '$tmp'\n"
28 while {[file exists
$tmp] <= 0} {exec sleep 0}
29 set at [.fra.options nearest
0]
30 set f
[ open gnu-optionsxx
]
31 .fra.options delete
0 end
32 while { [gets
$f line
] > 0 } {
33 .fra.options insert end
"$line"
35 .fra.options yview
$at
39 label .fra.label
-text "Current Set Options"
40 scrollbar .fra.scroll
-command ".fra.options yview"
41 listbox .fra.options
-yscrollcommand ".fra.scroll set" -relief sunken
-bd 2
43 pack .fra.options
-side left
44 pack .fra.scroll
-side right
-fill y
45 bind .fra.options
<Double-1
> "set selected_option \[lindex \[selection get\] 0\]"
49 sendgnu
[format
"%s\n\nreplot\n" [expr $
$a]] ;
53 proc mkOption_edit
{a b
} {
55 label
$a.label
-text "Edit: "
56 entry
$a.entry
-width 20 -relief sunken
-bd 2 -textvariable $b
57 bind $a.entry
<Return
> "msg $b"
58 pack
$a.label
$a.entry
-side left
-padx 1m
-pady 2m
61 mkOption_edit .option_edit selected_option
66 button .
exit -text "Exit" -command {
73 button .saveps
-text "Save gnuplot.ps" -command {
74 sendgnu
"set output 'gnuplot.ps';set terminal postscript ; replot\n"
75 sendgnu
"set terminal x11 ; replot; \n"
78 button .printps
-text "Print -Plw8" -command {
79 sendgnu
{set output
'|lpr -Plw8';set terminal postscript
; replot
}
80 sendgnu
"set terminal x11 ; replot; \n"
83 button .replot
-text "Replot" -command {
84 sendgnu
{set terminal x11
; replot
\n}
89 button .save
-text "save gnuplot.out" -command {
90 sendgnu
"save 'gnuplot.out'\n"
93 scale .rotxscale
-label "xrotation" \
94 -orient horizontal
-length 200 -from 0 -to 180 \
95 -command gnuPlotsetview
-tickinterval 60
96 scale .rotzscale
-label "zrotation" \
97 -orient horizontal
-length 200 -from 0 -to 360 \
98 -command gnuPlotsetview
-tickinterval 120
100 #.rotxscale set $xrot
101 #.rotzscale set $zrot
103 proc gnuPlotsetview value
{
104 sendgnu
[format
"set view %d,%d\nreplot\n" [.rotxscale get
] [.rotzscale get
]]}
106 pack .
exit .saveps .printps .rotxscale .rotzscale .fra .option_edit .save