diff options
-rw-r--r-- | ds9/library/plot.tcl | 13 | ||||
-rw-r--r-- | ds9/library/plotbar.tcl | 13 | ||||
-rw-r--r-- | ds9/library/plotdialog.tcl | 10 | ||||
-rw-r--r-- | ds9/library/plotline.tcl | 11 | ||||
-rw-r--r-- | ds9/library/plotscatter.tcl | 12 |
5 files changed, 48 insertions, 11 deletions
diff --git a/ds9/library/plot.tcl b/ds9/library/plot.tcl index 0cc8194..7c6e8b5 100644 --- a/ds9/library/plot.tcl +++ b/ds9/library/plot.tcl @@ -88,6 +88,19 @@ proc PlotAddPlot {varname} { global $varname global ds9 + + incr ${varname}(plot,total) + incr ${varname}(plot,current) 0 + + set cc $var(plot,current) + + set var(plot,$cc,data,total) 0 + set var(plot,$cc,data,current) 0 + + set var(data,total) $var(plot,$cc,data,total) + set var(data,current) $var(plot,$cc,data,current) + + $var(proc,addplot) $varname } proc PlotAxisFormat {varname axis w nn} { diff --git a/ds9/library/plotbar.tcl b/ds9/library/plotbar.tcl index d71c62d..27c1ac6 100644 --- a/ds9/library/plotbar.tcl +++ b/ds9/library/plotbar.tcl @@ -32,7 +32,8 @@ proc PlotBar {tt wtt title xaxis yaxis dim data} { PlotBarProc $varname PlotDialog $varname $wtt $title $xaxis $yaxis PlotDialogBar $varname - + PlotAddPlot $varname + PlotDataSet $varname $dim $data $var(proc,updategraph) $varname PlotStats $varname @@ -46,12 +47,14 @@ proc PlotBarDialog {varname wtt title xaxis yaxis} { PlotBarProc $varname PlotDialog $varname $wtt $title $xaxis $yaxis PlotDialogBar $varname + PlotAddPlot $varname } proc PlotBarProc {varname} { upvar #0 $varname var global $varname + set var(proc,addplot) PlotBarAddPlot set var(proc,updategraph) PlotBarUpdateGraph set var(proc,updateelement) PlotBarUpdateElement set var(proc,highlite) PlotBarHighliteElement @@ -139,7 +142,12 @@ proc PlotDialogBar {varname} { WidthDashMenu $var(mb).data.error.width $varname error,width {} \ [list PlotBarUpdateElement $varname] {} - # graph +} + +proc PlotBarAddPlot {varname} { + upvar #0 $varname var + global $varname + set var(type) bar set var(graph) [ttk::frame $var(top).fr] set var(plot) [blt::barchart $var(graph).bar \ @@ -155,6 +163,7 @@ proc PlotDialogBar {varname} { pack $var(graph) -expand yes -fill both # set up zoom stack, assuming mode is zoom + global ds9 switch $ds9(wm) { x11 - win32 {Blt_ZoomStack $var(plot) -mode release} diff --git a/ds9/library/plotdialog.tcl b/ds9/library/plotdialog.tcl index 65cad6b..51c557f 100644 --- a/ds9/library/plotdialog.tcl +++ b/ds9/library/plotdialog.tcl @@ -27,9 +27,6 @@ proc PlotDialog {varname wtt title xaxis yaxis} { set var(mode) zoom set var(callback) {} - set var(data,total) 0 - set var(data,current) 0 - set var(name) {} set var(xdata) {} set var(ydata) {} @@ -38,9 +35,7 @@ proc PlotDialog {varname wtt title xaxis yaxis} { array set $varname [array get pap] - set var(graph,title) "$title" - set var(axis,x,title) "$xaxis" - set var(axis,y,title) "$yaxis" + PlotTitle $varname $title $xaxis $yaxis # can be turned off for external line plots set var(graph,format) 1 @@ -228,6 +223,9 @@ proc PlotDialog {varname wtt title xaxis yaxis} { # dataset menu $var(mb).data + + set var(plot,total) 0 + set var(plot,current) 0 } proc PlotDataFormatDialog {xarname} { diff --git a/ds9/library/plotline.tcl b/ds9/library/plotline.tcl index f3763e8..633d72e 100644 --- a/ds9/library/plotline.tcl +++ b/ds9/library/plotline.tcl @@ -32,6 +32,7 @@ proc PlotLine {tt wtt title xaxis yaxis dim data} { PlotLineProc $varname PlotDialog $varname $wtt $title $xaxis $yaxis PlotDialogLine $varname + PlotAddPlot $varname PlotDataSet $varname $dim $data $var(proc,updategraph) $varname @@ -46,6 +47,7 @@ proc PlotLineDialog {varname wtt title xaxis yaxis} { PlotLineProc $varname PlotDialog $varname $wtt $title $xaxis $yaxis PlotDialogLine $varname + PlotAddPlot $varname } proc PlotLineProc {varname} { @@ -53,6 +55,7 @@ proc PlotLineProc {varname} { global $varname set var(proc,updategraph) PlotUpdateGraph + set var(proc,addplot) PlotLineAddPlot set var(proc,updateelement) PlotLineUpdateElement set var(proc,highlite) PlotLineHighliteElement set var(proc,button) PlotLineButton @@ -219,7 +222,12 @@ proc PlotDialogLine {varname} { WidthDashMenu $var(mb).data.error.width $varname error,width {} \ [list PlotLineUpdateElement $varname] {} - # graph +} + +proc PlotLineAddPlot {varname} { + upvar #0 $varname var + global $varname + set var(type) line set var(graph) [ttk::frame $var(top).fr] set var(plot) [blt::graph $var(graph).line \ @@ -232,6 +240,7 @@ proc PlotDialogLine {varname} { pack $var(graph) -expand yes -fill both # set up zoom stack, assuming mode is zoom + global ds9 switch $ds9(wm) { x11 - win32 {Blt_ZoomStack $var(plot) -mode release} diff --git a/ds9/library/plotscatter.tcl b/ds9/library/plotscatter.tcl index 1c66bb5..05f36f1 100644 --- a/ds9/library/plotscatter.tcl +++ b/ds9/library/plotscatter.tcl @@ -32,7 +32,8 @@ proc PlotScatter {tt wtt title xaxis yaxis dim data} { PlotScatterProc $varname PlotDialog $varname $wtt $title $xaxis $yaxis PlotDialogScatter $varname - + PlotAddPlot $varname + PlotDataSet $varname $dim $data $var(proc,updategraph) $varname PlotStats $varname @@ -46,12 +47,14 @@ proc PlotScatterDialog {varname wtt title xaxis yaxis} { PlotScatterProc $varname PlotDialog $varname $wtt $title $xaxis $yaxis PlotDialogScatter $varname + PlotAddPlot $varname } proc PlotScatterProc {varname} { upvar #0 $varname var global $varname + set var(proc,addplot) PlotScatterAddPlot set var(proc,updategraph) PlotUpdateGraph set var(proc,updateelement) PlotScatterUpdateElement set var(proc,highlite) PlotScatterHighliteElement @@ -145,8 +148,12 @@ proc PlotDialogScatter {varname} { [list PlotScatterUpdateElement $varname] WidthDashMenu $var(mb).data.error.width $varname error,width {} \ [list PlotScatterUpdateElement $varname] {} +} + +proc PlotScatterAddPlot {varname} { + upvar #0 $varname var + global $varname - # graph set var(type) scatter set var(graph) [ttk::frame $var(top).fr] set var(plot) [blt::graph $var(graph).scatter \ @@ -159,6 +166,7 @@ proc PlotDialogScatter {varname} { pack $var(graph) -expand yes -fill both # set up zoom stack, assuming mode is zoom + global ds9 switch $ds9(wm) { x11 - win32 {Blt_ZoomStack $var(plot) -mode release} |