/usr/share/saods9/src/plotelement.tcl is in saods9-data 7.2+dfsg-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | # Copyright (C) 1999-2012
# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
# For conditions of distribution and use, see copyright notice in "copyright"
package provide DS9 1.0
proc PlotCreateErrorX {varname} {
upvar #0 $varname var
global $varname
set nn $var(data,current)
set err {}
# delete markers
foreach mk [$var(graph) marker names "m-${nn}-x*"] {
$var(graph) marker delete $mk
}
global $var(xdata) $var(ydata) $var(xedata)
set ll [$var(xdata) length]
set xx [$var(xdata) range]
set yy [$var(ydata) range]
set xe [$var(xedata) range]
for {set ii 0} {$ii<$ll} {incr ii} {
set x [lindex $xx $ii]
set y [lindex $yy $ii]
set e [lindex $xe $ii]
$var(graph) marker create line \
-name "m-${nn}-x${ii}" \
-coords "[expr $x+$e] $y [expr $x-$e] $y" \
-linewidth $var(error,width) \
-outline $var(error,color)
}
}
proc PlotCreateErrorY {varname} {
upvar #0 $varname var
global $varname
set nn $var(data,current)
set err {}
# delete markers
foreach mk [$var(graph) marker names "m-${nn}-y*"] {
$var(graph) marker delete $mk
}
global $var(xdata) $var(ydata) $var(yedata)
set ll [$var(xdata) length]
set xx [$var(xdata) range]
set yy [$var(ydata) range]
set ye [$var(yedata) range]
for {set ii 0} {$ii<$ll} {incr ii} {
set x [lindex $xx $ii]
set y [lindex $yy $ii]
set e [lindex $ye $ii]
$var(graph) marker create line \
-name "m-${nn}-y${ii}" \
-coords "$x [expr $y-$e] $x [expr $y+$e] " \
-linewidth $var(error,width) \
-outline $var(error,color)
}
}
proc PlotUpdateElementDiscrete {varname} {
upvar #0 $varname var
global $varname
# warning: uses current vars
if {$var(data,total) == 0} {
return
}
set nn $var(data,current)
set var($nn,discrete,color) $var(discrete,color)
set var($nn,discrete,symbol) $var(discrete,symbol)
set var($nn,discrete,fill) $var(discrete,fill)
if {$var(discrete)} {
if {$var(discrete,fill)} {
set clr $var(discrete,color)
} else {
set clr {}
}
$var(graph) element configure "d-${nn}" \
-outline $var(discrete,color) -color $var(discrete,color) \
-symbol $var(discrete,symbol) -fill $clr
}
}
proc PlotUpdateElementLinear {varname} {
upvar #0 $varname var
global $varname
# warning: uses current vars
if {$var(data,total) == 0} {
return
}
set nn $var(data,current)
set var($nn,linear,color) $var(linear,color)
set var($nn,linear,width) $var(linear,width)
if {$var(linear)} {
if {$var(linear,dash) == {yes}} {
set dash {8 3}
} else {
set dash { }
}
$var(graph) element configure "l-${nn}" \
-linewidth $var(linear,width) -dashes $dash \
-color $var(linear,color)
}
}
proc PlotUpdateElementStep {varname} {
upvar #0 $varname var
global $varname
# warning: uses current vars
if {$var(data,total) == 0} {
return
}
set nn $var(data,current)
set var($nn,step,color) $var(step,color)
set var($nn,step,width) $var(step,width)
if {$var(step)} {
if {$var(step,dash) == {yes}} {
set dash {8 3}
} else {
set dash { }
}
$var(graph) element configure "s-${nn}" \
-linewidth $var(step,width) -dashes $dash \
-color $var(step,color)
}
}
proc PlotUpdateElementQuadratic {varname} {
upvar #0 $varname var
global $varname
# warning: uses current vars
if {$var(data,total) == 0} {
return
}
set nn $var(data,current)
set var($nn,quadratic,color) $var(quadratic,color)
set var($nn,quadratic,width) $var(quadratic,width)
if {$var(quadratic)} {
if {$var(quadratic,dash) == {yes}} {
set dash {8 3}
} else {
set dash { }
}
$var(graph) element configure "q-${nn}" \
-linewidth $var(quadratic,width) -dashes $dash \
-color $var(quadratic,color)
}
}
proc PlotUpdateElementBar {varname} {
upvar #0 $varname var
global $varname
# warning: uses current vars
if {$var(data,total) == 0} {
return
}
set nn $var(data,current)
set var($nn,bar,color) $var(bar,color)
if {$var(bar)} {
switch $var(bar,color) {
black {set clr "#000001"}
default {set clr $var(bar,color)}
}
$var(graph) element configure "b-${nn}" \
-foreground $clr -background $clr
}
}
proc PlotUpdateElementError {varname} {
upvar #0 $varname var
global $varname
# warning: uses current vars
if {$var(data,total) == 0} {
return
}
set nn $var(data,current)
set var($nn,error,color) $var(error,color)
set var($nn,error,width) $var(error,width)
foreach mk [$var(graph) marker names "m-${nn}*"] {
$var(graph) marker configure $mk \
-linewidth $var(error,width) \
-outline $var(error,color)
}
}
proc PlotHighliteElement {varname rowlist} {
upvar #0 $varname var
global $varname
# rowlist starts at 1
set result {}
foreach rr $rowlist {
append result "[expr $rr-1] "
}
$var(proc,highlite) $varname $result
}
|