From ceacb55ce91d7419ebb7b78e3c0c009172b22e8a Mon Sep 17 00:00:00 2001 From: William Joye Date: Tue, 16 Jul 2019 16:36:18 -0400 Subject: support multiple graphs per plot --- ds9/library/catplot.tcl | 4 ++-- ds9/library/plot.tcl | 9 --------- ds9/library/plotbar.tcl | 8 +++++++- ds9/library/plotdialog.tcl | 4 +--- ds9/library/plotline.tcl | 8 +++++++- ds9/library/plotscatter.tcl | 8 +++++++- 6 files changed, 24 insertions(+), 17 deletions(-) diff --git a/ds9/library/catplot.tcl b/ds9/library/catplot.tcl index 629e779..8c0474f 100644 --- a/ds9/library/catplot.tcl +++ b/ds9/library/catplot.tcl @@ -76,7 +76,7 @@ proc CATPlotGenerate {varname} { set ping [PlotPing $vvarname] if {!$ping} { - PlotScatterDialog $vvarname $var(title) {} {} {} + PlotScatterDialog $vvarname $var(title) $var(title) $xtitle $ytitle set vvar(mode) pointer PlotChangeMode $vvarname @@ -86,7 +86,7 @@ proc CATPlotGenerate {varname} { set var(plot,var) $vvarname } - PlotTitle $vvarname $var(title) $xtitle $ytitle +# PlotTitle $vvarname $var(title) $xtitle $ytitle PlotDeleteDataSetAll $vvarname PlotAddDataSet $vvarname $dim $rr PlotStats $vvarname diff --git a/ds9/library/plot.tcl b/ds9/library/plot.tcl index 62afc08..5a4408e 100644 --- a/ds9/library/plot.tcl +++ b/ds9/library/plot.tcl @@ -692,15 +692,6 @@ proc PlotColorMenu {w varname color cmd} { -command [list ColorMenuOther $varname $color $cmd] } -proc PlotTitle {varname title xaxis yaxis} { - upvar #0 $varname var - global $varname - - set var(graph,title) "$title" - set var(graph,axis,x,title) "$xaxis" - set var(graph,axis,y,title) "$yaxis" -} - proc PlotBackup {ch dir} { global iap diff --git a/ds9/library/plotbar.tcl b/ds9/library/plotbar.tcl index 8db519c..580039b 100644 --- a/ds9/library/plotbar.tcl +++ b/ds9/library/plotbar.tcl @@ -58,9 +58,15 @@ proc PlotBarDialog {varname wtt title xaxis yaxis} { set var(proc,highlite) PlotHighliteElement set var(proc,button) PlotButton - PlotDialog $varname $wtt $title $xaxis $yaxis + PlotDialog $varname $wtt PlotAddGraph $varname + set var(graph,title) "$title" + set var(graph,axis,x,title) "$xaxis" + set var(graph,axis,y,title) "$yaxis" + + $var(proc,updategraph) $varname + # Graph $var(mb).graph add separator $var(mb).graph add cascade -label "[msgcat::mc {Mode}]..." \ diff --git a/ds9/library/plotdialog.tcl b/ds9/library/plotdialog.tcl index 242d9c6..344e19e 100644 --- a/ds9/library/plotdialog.tcl +++ b/ds9/library/plotdialog.tcl @@ -4,7 +4,7 @@ package provide DS9 1.0 -proc PlotDialog {varname wtt title xaxis yaxis} { +proc PlotDialog {varname wtt} { upvar #0 $varname var global $varname @@ -32,8 +32,6 @@ proc PlotDialog {varname wtt title xaxis yaxis} { array set $varname [array get pap] - PlotTitle $varname $title $xaxis $yaxis - # create window Toplevel $var(top) $var(mb) 7 $wtt [list PlotDestroy $varname] diff --git a/ds9/library/plotline.tcl b/ds9/library/plotline.tcl index a03f2d6..7ddc70b 100644 --- a/ds9/library/plotline.tcl +++ b/ds9/library/plotline.tcl @@ -58,9 +58,15 @@ proc PlotLineDialog {varname wtt title xaxis yaxis} { set var(proc,highlite) PlotHighliteElement set var(proc,button) PlotButton - PlotDialog $varname $wtt $title $xaxis $yaxis + PlotDialog $varname $wtt PlotAddGraph $varname + set var(graph,title) "$title" + set var(graph,axis,x,title) "$xaxis" + set var(graph,axis,y,title) "$yaxis" + + $var(proc,updategraph) $varname + # Data $var(mb).data add checkbutton -label [msgcat::mc {Show}] \ -variable ${varname}(graph,ds,show) \ diff --git a/ds9/library/plotscatter.tcl b/ds9/library/plotscatter.tcl index 5496235..2291265 100644 --- a/ds9/library/plotscatter.tcl +++ b/ds9/library/plotscatter.tcl @@ -58,9 +58,15 @@ proc PlotScatterDialog {varname wtt title xaxis yaxis} { set var(proc,highlite) PlotScatterHighliteElement set var(proc,button) PlotScatterButton - PlotDialog $varname $wtt $title $xaxis $yaxis + PlotDialog $varname $wtt PlotAddGraph $varname + set var(graph,title) "$title" + set var(graph,axis,x,title) "$xaxis" + set var(graph,axis,y,title) "$yaxis" + + $var(proc,updategraph) $varname + # Data $var(mb).data add checkbutton -label [msgcat::mc {Show}] \ -variable ${varname}(graph,ds,show) \ -- cgit v0.12