Changeset 1165


Ignore:
Timestamp:
08/17/2011 06:01:06 PM (19 months ago)
Author:
toby
Message:

add path fix to expgui; improve liveplot pdf export speed, remove out-of-view markers

Location:
branches/sandbox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/expgui

    r1160 r1165  
    123123    set expgui(script) [file join [pwd] $expgui(script)] 
    124124} 
     125set expgui(script) [file normalize $expgui(script)] 
    125126# save the package installation location; fix if possible, warn later (after  
    126127# routines are sourced) 
  • branches/sandbox/gnuplot.tcl

    r1157 r1165  
    1616 
    1717    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 
    2221    foreach element_name $element_list { 
    2322        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 
    2430        if {$heading != ""} {append heading ","} 
    2531        append heading  [$graph_name axis cget x -title] 
    2632        append heading "," 
    2733        append heading $element_name 
    28         # get xy data for this element 
    29         set data_list [eval $element_cmd -data] 
    30  
    31         #if there is no data, skip this set 
    32         if {[llength $data_list] == 0} continue 
    33         set i 0 
    34         foreach {x y} $data_list { 
    35             incr i 
    36             if {[array names datalisting $i] == ""} { 
    37                 # new element, append any missing commas 
    38                 set datalisting($i) "${commas}$x,$y" 
    39             } else { 
    40                 append datalisting($i) ,$x,$y 
    41             } 
    42         } 
    43         append commas {,,} 
    4434    } 
    4535    #For Gnuplot exports, the column labels need to be commented out 
     
    4939        puts $fp $heading 
    5040    } 
    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 
    5449    } 
    5550    close $fp 
     
    212207                    } 
    213208                } 
     209            if {$x1 < $xmin || $x1 > $xmax} {continue} 
    214210            # replace newlines 
    215211            regsub -all "\n" $txt {\n} txt 
     
    235231                    } 
    236232                } 
     233            if {$x1 < $xmin || $x2 > $xmax} {continue} 
    237234            puts $gplotfp "set arrow from first $x1,$y1 to first $x2,$y2 nohead lc rgbcolor \"$str\""  
    238235        } else { 
Note: See TracChangeset for help on using the changeset viewer.