Changeset 736 for trunk/gui/scripts


Ignore:
Timestamp:
May 14, 2007, 11:44:47 PM (17 years ago)
Author:
dkearney
Message:

adding capabilities for xy scatter plots by adding curve.about.type = scatter to your run.xml file

Location:
trunk/gui/scripts
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/curve.tcl

    r413 r736  
    193193            color   about.color
    194194            style   about.style
     195            type    about.type
    195196            xlabel  xaxis.label
    196197            xdesc   xaxis.description
  • trunk/gui/scripts/resultviewer.tcl

    r468 r736  
    168168                        eval lappend settings $style
    169169                    }
     170                    if {[catch {$dobj hints type} type] == 0} {
     171                        if {"" != $type} {
     172                            eval lappend settings "-type $type"
     173                        }
     174                    }
    170175                    # add override settings passed in here
    171176                    eval lappend settings $opts
  • trunk/gui/scripts/xyresult.tcl

    r676 r736  
    217217        -brightness 0
    218218        -width 1
     219        -type "line"
    219220        -raise 0
    220221        -linestyle solid
     
    226227        }
    227228        set params($opt) $val
     229    }
     230
     231    # if type is set to "scatter", then override the width
     232    if {"scatter" == $params(-type)} {
     233        set params(-width) 0
    228234    }
    229235
     
    631637            }
    632638
    633             if {[$xv length] <= 1} {
     639            if {([$xv length] <= 1) || ($lwidth == 0)} {
    634640                set sym square
     641                set pixels 2
    635642            } else {
    636643                set sym ""
     644                set pixels 6
    637645            }
    638646
     
    641649
    642650            $g element create $elem -x $xv -y $yv \
    643                 -symbol $sym -pixels 6 -linewidth $lwidth -label $label \
     651                -symbol $sym -pixels $pixels -linewidth $lwidth -label $label \
    644652                -color $color -dashes $dashes \
    645653                -mapx $mapx -mapy $mapy
     
    750758    if {$state == "at"} {
    751759        if {[$g element closest $x $y info -interpolate yes]} {
     760            # for dealing with xy line plots
    752761            set elem $info(name)
    753762            foreach {mapx mapy} [_getAxes $_elem2curve($elem)] break
     
    757766            if {[$g element closest $x $y info -interpolate no]
    758767                  && $info(name) == $elem} {
     768                set x [$g axis transform $mapx $info(x)]
     769                set y [$g axis transform $mapy $info(y)]
     770
     771                if {[info exists _elem2curve($elem)]} {
     772                    set curve $_elem2curve($elem)
     773                    set tip [$curve hints tooltip]
     774                    if {[info exists info(y)]} {
     775                        set val [_axis format y dummy $info(y)]
     776                        set units [$curve hints yunits]
     777                        append tip "\n$val$units"
     778
     779                        if {[info exists info(x)]} {
     780                            set val [_axis format x dummy $info(x)]
     781                            set units [$curve hints xunits]
     782                            append tip " @ $val$units"
     783                        }
     784                    }
     785                    set tip [string trim $tip]
     786                }
     787            }
     788            set state 1
     789        } elseif {[$g element closest $x $y info -interpolate no]} {
     790            # for dealing with xy scatter plot
     791            set elem $info(name)
     792            foreach {mapx mapy} [_getAxes $_elem2curve($elem)] break
     793
     794            # search again for an exact point -- this time don't interpolate
     795            set tip ""
     796            if {$info(name) == $elem} {
    759797                set x [$g axis transform $mapx $info(x)]
    760798                set y [$g axis transform $mapy $info(y)]
Note: See TracChangeset for help on using the changeset viewer.