Changeset 21 for sans/utils/bt5


Ignore:
Timestamp:
Dec 13, 2006 11:36:14 AM (16 years ago)
Author:
ajj
Message:

Added log/lin options for both axes. Note that the log option does the log of abs(value) so that negative values are reflected back onto the positive axis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/utils/bt5/bt5plot/bt5plot

    r20 r21  
    184184        } 
    185185} 
    186          
     186 
     187proc changeLogLinY {} { 
     188        global graph 
     189        global loglinY 
     190 
     191        $graph axis configure y -logscale $loglinY 
     192}        
     193 
     194proc changeLogLinX {} { 
     195        global graph 
     196        global loglinX 
     197 
     198        $graph axis configure x -logscale $loglinX 
     199}        
     200 
    187201proc LoadTree { tree parentNode dir } { 
    188202        cd $dir 
     
    204218        if {$dir ne ""} { 
    205219                EmptyTree .tree 
    206                 LoadTree .tree 0 $dir 
     220                catch { LoadTree .tree 0 $dir } result 
    207221                cd $dir 
    208222        }        
     
    284298#Plot controls 
    285299set pcf [frame .filter.pc] 
     300#Clear plot button 
    286301button $pcf.filterReset -text "Clear Plot" -command {resetGraph} 
    287 radiobutton $pcf.c -text "Counts" -variable plotType -value "count" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
    288 radiobutton $pcf.cr -text "Count Rate" -variable plotType -value "countrate" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
    289 radiobutton $pcf.t -text "Trans" -variable plotType -value "trans" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
    290 radiobutton $pcf.m -text "Mon" -variable plotType -value "mon" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
    291 $pcf.c select 
     302 
     303#Frame for radiobutton set to control plot type 
     304set ptf [frame .filter.pc.pt -borderwidth 1 -relief raised] 
     305radiobutton $ptf.c -text "Counts" -variable plotType -value "count" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     306radiobutton $ptf.cr -text "Count Rate" -variable plotType -value "countrate" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     307radiobutton $ptf.t -text "Trans" -variable plotType -value "trans" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     308radiobutton $ptf.m -text "Mon" -variable plotType -value "mon" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     309$ptf.c select 
     310pack $ptf.m -side right 
     311pack $ptf.t -side right 
     312pack $ptf.cr -side right 
     313pack $ptf.c -side right  
     314 
     315#Frame for y-axis log/lin choice 
     316set logfy [frame .filter.pc.logy -borderwidth 1 -relief raised] 
     317#Log/lin radiobutton set 
     318radiobutton $logfy.log -text "Log Y" -variable loglinY -value "yes" -command { changeLogLinY } 
     319radiobutton $logfy.lin -text "Lin Y" -variable loglinY -value "no" -command { changeLogLinY } 
     320$logfy.lin select 
     321pack $logfy.log -side right 
     322pack $logfy.lin -side right 
     323 
     324#Frame for y-axis log/lin choice 
     325set logfx [frame .filter.pc.logx -borderwidth 1 -relief raised] 
     326#Log/lin radiobutton set 
     327radiobutton $logfx.log -text "Log X" -variable loglinX -value "yes" -command { changeLogLinX } 
     328radiobutton $logfx.lin -text "Lin X" -variable loglinX -value "no" -command { changeLogLinX } 
     329$logfx.lin select 
     330pack $logfx.log -side right 
     331pack $logfx.lin -side right 
     332 
    292333pack $pcf.filterReset -side right -padx 25 
    293 pack $pcf.m -side right 
    294 pack $pcf.t -side right 
    295 pack $pcf.cr -side right 
    296 pack $pcf.c -side right  
     334pack $logfy -side right 
     335pack $logfx -side right 
     336pack $ptf -side right 
    297337pack $pcf -side right 
    298338 
Note: See TracChangeset for help on using the changeset viewer.