diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2019-06-05 20:44:51 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2019-06-05 20:44:51 (GMT) |
commit | 6b702c4ddb91ac7b56b755b9e949d435cd1d19cb (patch) | |
tree | 6901b6920bb813aee761bdc526c30ef1ce103bbf | |
parent | 165efffa5b47eaf5cc304ce3c07d2a73ba87f702 (diff) | |
download | blt-6b702c4ddb91ac7b56b755b9e949d435cd1d19cb.zip blt-6b702c4ddb91ac7b56b755b9e949d435cd1d19cb.tar.gz blt-6b702c4ddb91ac7b56b755b9e949d435cd1d19cb.tar.bz2 |
add multiple plot support
-rw-r--r-- | ds9/library/markeranalysishist.tcl | 2 | ||||
-rw-r--r-- | ds9/library/markeranalysisplot2d.tcl | 2 | ||||
-rw-r--r-- | ds9/library/markeranalysisplot3d.tcl | 2 | ||||
-rw-r--r-- | ds9/library/markeranalysisradial.tcl | 2 | ||||
-rw-r--r-- | ds9/library/plot.tcl | 8 | ||||
-rw-r--r-- | ds9/library/plotdata.tcl | 20 | ||||
-rw-r--r-- | ds9/library/plotstate.tcl | 6 |
7 files changed, 22 insertions, 20 deletions
diff --git a/ds9/library/markeranalysishist.tcl b/ds9/library/markeranalysishist.tcl index 6ca4cda..e945e26 100644 --- a/ds9/library/markeranalysishist.tcl +++ b/ds9/library/markeranalysishist.tcl @@ -83,7 +83,7 @@ proc MarkerAnalysisHistogramCB {frame id} { set cc $vvar(graph,current) set vvar($cc,manage) 0 - set vvar($cc,dim) xy + set vvar(graph,ds,dim) xy set vvar(graph,ds,xdata) $xdata set vvar(graph,ds,ydata) $ydata blt::vector create $xdata $ydata diff --git a/ds9/library/markeranalysisplot2d.tcl b/ds9/library/markeranalysisplot2d.tcl index 6b16f14..4c1deb4 100644 --- a/ds9/library/markeranalysisplot2d.tcl +++ b/ds9/library/markeranalysisplot2d.tcl @@ -172,7 +172,7 @@ proc MarkerAnalysisPlot2dCB {frame id} { set cc $vvar(graph,current) set vvar($cc,manage) 0 - set vvar($cc,dim) xy + set vvar(graph,ds,dim) xy set vvar(graph,ds,xdata) $xdata set vvar(graph,ds,ydata) $ydata blt::vector create $xdata $ydata $xcdata $ycdata diff --git a/ds9/library/markeranalysisplot3d.tcl b/ds9/library/markeranalysisplot3d.tcl index 80b50be..244e666 100644 --- a/ds9/library/markeranalysisplot3d.tcl +++ b/ds9/library/markeranalysisplot3d.tcl @@ -177,7 +177,7 @@ proc MarkerAnalysisPlot3dCB {frame id} { set cc $vvar(graph,current) set vvar($cc,manage) 0 - set vvar($cc,dim) xy + set vvar(graph,ds,dim) xy set vvar(graph,ds,xdata) $xdata set vvar(graph,ds,ydata) $ydata blt::vector create $xdata $ydata diff --git a/ds9/library/markeranalysisradial.tcl b/ds9/library/markeranalysisradial.tcl index c489820..6c5d506 100644 --- a/ds9/library/markeranalysisradial.tcl +++ b/ds9/library/markeranalysisradial.tcl @@ -110,7 +110,7 @@ proc MarkerAnalysisRadialCB {frame id} { set cc $vvar(graph,current) set vvar($cc,manage) 0 - set vvar($cc,dim) xyey + set vvar(graph,ds,dim) xyey set vvar(graph,ds,xdata) $xdata set vvar(graph,ds,ydata) $ydata set vvar(graph,ds,yedata) $yedata diff --git a/ds9/library/plot.tcl b/ds9/library/plot.tcl index 7f0d098..bdcb8c2 100644 --- a/ds9/library/plot.tcl +++ b/ds9/library/plot.tcl @@ -85,6 +85,7 @@ proc PlotAddData {varname} { global $varname set cc $var(graph,current) + set nn $var($cc,data,current) # warning: uses current vars if {$var($cc,data,total) == 0} { @@ -92,7 +93,6 @@ proc PlotAddData {varname} { } # delete current elements - set nn $var($cc,data,current) foreach el [$var($cc) element names] { set f [split $el -] if {[lindex $f 1] == $nn} { @@ -219,7 +219,6 @@ proc PlotCurrentData {varname} { set nn $var($cc,data,current) set var($cc,manage) $var($cc,$nn,manage) - set var($cc,dim) $var($cc,$nn,dim) PlotRestoreState $varname $nn } @@ -314,7 +313,6 @@ proc PlotExternal {varname} { set var(graph,ds,name) "Dataset $nn" set var($cc,$nn,manage) $var($cc,manage) - set var($cc,$nn,dim) $var($cc,dim) PlotSaveState $varname @@ -354,7 +352,7 @@ proc PlotListGenerate {varname} { set xx [$var(graph,ds,xdata) range] set yy [$var(graph,ds,ydata) range] - switch $var($cc,dim) { + switch $var(graph,ds,dim) { xy { for {set ii 0} {$ii<$ll} {incr ii} { append rr "[lindex $xx $ii] [lindex $yy $ii]\n" @@ -661,7 +659,7 @@ proc PlotBackup {ch dir} { PlotSaveDataFile $varname "$fdir/plot$ii.dat" PlotSaveConfigFile $varname "$fdir/plot$ii.plt" - puts $ch "PlotLoadDataFile $varname $fdir/plot$ii.dat $var($cc,dim)" + puts $ch "PlotLoadDataFile $varname $fdir/plot$ii.dat $var($cc,$ii,dim)" puts $ch "PlotLoadConfigFile $varname $fdir/plot$ii.plt" } set ${varname}($cc,data,current) $save diff --git a/ds9/library/plotdata.tcl b/ds9/library/plotdata.tcl index b4c58be..ea380af 100644 --- a/ds9/library/plotdata.tcl +++ b/ds9/library/plotdata.tcl @@ -107,7 +107,7 @@ proc PlotDataSetOne {varname dim data} { switch -- $dim { 2 - xy { - set var($cc,dim) xy + set var(graph,ds,dim) xy for {set ii 0} {$ii<$ll} {incr ii 2} { lappend x [lindex $data $ii] @@ -118,7 +118,7 @@ proc PlotDataSetOne {varname dim data} { } xyex { - set var($cc,dim) xyex + set var(graph,ds,dim) xyex set var(graph,ds,xedata) $xedata global $var(graph,ds,xedata) @@ -136,7 +136,7 @@ proc PlotDataSetOne {varname dim data} { 3 - xyey { - set var($cc,dim) xyey + set var(graph,ds,dim) xyey set var(graph,ds,yedata) $yedata global $var(graph,ds,yedata) @@ -153,7 +153,7 @@ proc PlotDataSetOne {varname dim data} { } xyexey { - set var($cc,dim) xyexey + set var(graph,ds,dim) xyexey set var(graph,ds,xedata) $xedata set var(graph,ds,yedata) $yedata @@ -173,7 +173,7 @@ proc PlotDataSetOne {varname dim data} { } 4.1 { - set var($cc,dim) xyey + set var(graph,ds,dim) xyey set var(graph,ds,yedata) $yedata global $var(graph,ds,yedata) @@ -190,7 +190,7 @@ proc PlotDataSetOne {varname dim data} { } 4.2 { - set var($cc,dim) xy + set var(graph,ds,dim) xy for {set ii 0} {$ii<$ll} {incr ii 4} { lappend x [lindex $data $ii] @@ -201,7 +201,7 @@ proc PlotDataSetOne {varname dim data} { } 5.1 { - set var($cc,dim) xyey + set var(graph,ds,dim) xyey set var(graph,ds,yedata) $yedata global $var(graph,ds,yedata) @@ -218,7 +218,7 @@ proc PlotDataSetOne {varname dim data} { } 5.2 { - set var($cc,dim) xyey + set var(graph,ds,dim) xyey set var(graph,ds,yedata) $yedata global $var(graph,ds,yedata) @@ -236,7 +236,6 @@ proc PlotDataSetOne {varname dim data} { } set var($cc,$nn,manage) 1 - set var($cc,$nn,dim) $var($cc,dim) PlotSaveState $varname @@ -327,7 +326,6 @@ proc PlotDupData {varname mm} { set var($cc,data,current) $nn set var($cc,manage) $var($cc,$nn,manage) - set var($cc,dim) $var($cc,$nn,dim) PlotRestoreState $varname $nn @@ -402,7 +400,7 @@ proc PlotSaveDataFile {varname filename} { set yy [$var(graph,ds,ydata) range] set ch [open $filename w] - switch $var($cc,dim) { + switch $var(graph,ds,dim) { xy { for {set ii 0} {$ii<$ll} {incr ii} { puts $ch "[lindex $xx $ii] [lindex $yy $ii]" diff --git a/ds9/library/plotstate.tcl b/ds9/library/plotstate.tcl index c75b14a..f511d07 100644 --- a/ds9/library/plotstate.tcl +++ b/ds9/library/plotstate.tcl @@ -113,6 +113,8 @@ proc PlotInitGraph {varname} { set var(graph,axis,y,format) $pap(graph,axis,y,format) # per DataSet + set var(graph,ds,dim) xy + set var(graph,ds,xdata) {} set var(graph,ds,ydata) {} set var(graph,ds,xedata) {} @@ -172,6 +174,8 @@ proc PlotSaveState {varname} { set var($cc,axis,y,format) $var(graph,axis,y,format) # per DataSet + set var($cc,$nn,dim) $var(graph,ds,dim) + set var($cc,$nn,xdata) $var(graph,ds,xdata) set var($cc,$nn,ydata) $var(graph,ds,ydata) set var($cc,$nn,xedata) $var(graph,ds,xedata) @@ -231,6 +235,8 @@ proc PlotRestoreState {varname nn} { set var(graph,axis,y,format) $var($cc,axis,y,format) # per DataSet + set var(graph,ds,dim) $var($cc,$nn,dim) + set var(graph,ds,xdata) $var($cc,$nn,xdata) set var(graph,ds,ydata) $var($cc,$nn,ydata) set var(graph,ds,xedata) $var($cc,$nn,xedata) |