Changeset 1165
- Timestamp:
- 08/17/2011 06:01:06 PM (19 months ago)
- Location:
- branches/sandbox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sandbox/expgui
r1160 r1165 123 123 set expgui(script) [file join [pwd] $expgui(script)] 124 124 } 125 set expgui(script) [file normalize $expgui(script)] 125 126 # save the package installation location; fix if possible, warn later (after 126 127 # routines are sourced) -
branches/sandbox/gnuplot.tcl
r1157 r1165 16 16 17 17 set heading "" 18 catch {unset datalisting} 19 # set index [llength $element_list] 20 # while {[incr index -1] >= 0} 21 # set element_name [lindex $element_list $index] 18 set num 0 19 catch {unset data_list} 20 set max 0 22 21 foreach element_name $element_list { 23 22 set element_cmd "$graph_name element cget $element_name" 23 # get xy data for this element 24 set data_list($num) [eval $element_cmd -data] 25 #if there is no data, skip this set 26 set pts [llength $data_list($num)] 27 if {$pts > $max} {set max $pts} 28 if {[llength $data_list($num)] == 0} continue 29 incr num 24 30 if {$heading != ""} {append heading ","} 25 31 append heading [$graph_name axis cget x -title] 26 32 append heading "," 27 33 append heading $element_name 28 # get xy data for this element29 set data_list [eval $element_cmd -data]30 31 #if there is no data, skip this set32 if {[llength $data_list] == 0} continue33 set i 034 foreach {x y} $data_list {35 incr i36 if {[array names datalisting $i] == ""} {37 # new element, append any missing commas38 set datalisting($i) "${commas}$x,$y"39 } else {40 append datalisting($i) ,$x,$y41 }42 }43 append commas {,,}44 34 } 45 35 #For Gnuplot exports, the column labels need to be commented out … … 49 39 puts $fp $heading 50 40 } 51 set max [lindex [lsort -integer [array names datalisting]] end] 52 for {set i 1} {$i <= $max} {incr i} { 53 puts $fp $datalisting($i) 41 for {set i 0} {$i < $max} {incr i 2} { 42 set line "" 43 for {set n 0} {$n < $num} {incr n} { 44 # get xy data for this element 45 foreach {x y} [lrange $data_list($n) $i [expr {$i + 1}]] {} 46 append line "$x,$y," 47 } 48 puts $fp $line 54 49 } 55 50 close $fp … … 212 207 } 213 208 } 209 if {$x1 < $xmin || $x1 > $xmax} {continue} 214 210 # replace newlines 215 211 regsub -all "\n" $txt {\n} txt … … 235 231 } 236 232 } 233 if {$x1 < $xmin || $x2 > $xmax} {continue} 237 234 puts $gplotfp "set arrow from first $x1,$y1 to first $x2,$y2 nohead lc rgbcolor \"$str\"" 238 235 } else {
Note: See TracChangeset
for help on using the changeset viewer.