diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2019-06-07 18:51:01 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2019-06-07 18:51:01 (GMT) |
commit | 2ea2b0e83a4b3c58d82b13d4d26fdad5b3853d2e (patch) | |
tree | 2cd9294318e74edf37aaa301bdbd9f439e524645 | |
parent | 071832337409b3ff7cf063d16e1072e96d2d86f1 (diff) | |
download | blt-2ea2b0e83a4b3c58d82b13d4d26fdad5b3853d2e.zip blt-2ea2b0e83a4b3c58d82b13d4d26fdad5b3853d2e.tar.gz blt-2ea2b0e83a4b3c58d82b13d4d26fdad5b3853d2e.tar.bz2 |
support multiple graphs per plot
-rw-r--r-- | ds9/library/catplot.tcl | 2 | ||||
-rw-r--r-- | ds9/library/plot.tcl | 16 | ||||
-rw-r--r-- | ds9/library/plotdata.tcl | 17 |
3 files changed, 10 insertions, 25 deletions
diff --git a/ds9/library/catplot.tcl b/ds9/library/catplot.tcl index 7dc2bcc..1940f93 100644 --- a/ds9/library/catplot.tcl +++ b/ds9/library/catplot.tcl @@ -86,9 +86,9 @@ proc CATPlotGenerate {varname} { set var(plot,var) $vvarname } + PlotTitle $vvarname $var(title) $xtitle $ytitle PlotDeleteAllDataSet $vvarname PlotAddDataSet $vvarname $dim $rr - PlotTitle $vvarname $var(title) $xtitle $ytitle PlotStats $vvarname PlotList $vvarname } diff --git a/ds9/library/plot.tcl b/ds9/library/plot.tcl index 52f9ecf..6f29603 100644 --- a/ds9/library/plot.tcl +++ b/ds9/library/plot.tcl @@ -80,7 +80,7 @@ proc PlotDeleteGraph {varname} { } # Data -proc PlotAddData {varname} { +proc PlotAddElement {varname} { upvar #0 $varname var global $varname @@ -110,6 +110,11 @@ proc PlotAddData {varname} { -yerror $var(graph,ds,yedata) } } + + # update data set menu + $var(mb).graph.select add radiobutton -label "$var(graph,ds,name)" \ + -variable ${varname}($cc,data,current) -value $nn \ + -command [list PlotCurrentData $varname] } proc PlotCurrentGraph {varname} { @@ -224,14 +229,7 @@ proc PlotExternal {varname} { set var(graph,ds,name) "Dataset $nn" PlotSaveState $varname - - # update data set menu - $var(mb).graph.select add radiobutton \ - -label "[msgcat::mc {Dataset}] $nn" \ - -variable ${varname}($cc,data,current) -value $nn \ - -command "PlotCurrentData $varname" - - PlotAddData $varname + PlotAddElement $varname } proc PlotList {varname} { diff --git a/ds9/library/plotdata.tcl b/ds9/library/plotdata.tcl index 2849ccc..e36cada 100644 --- a/ds9/library/plotdata.tcl +++ b/ds9/library/plotdata.tcl @@ -232,13 +232,7 @@ proc PlotDataSetOne {varname dim data} { } PlotSaveState $varname - - # update data set menu - $var(mb).graph.select add radiobutton -label "$var(graph,ds,name)" \ - -variable ${varname}($cc,data,current) -value $nn \ - -command [list PlotCurrentData $varname] - - PlotAddData $varname + PlotAddElement $varname $var(proc,updateelement) $varname } @@ -311,18 +305,11 @@ proc PlotDupDataSet {varname mm} { set var($cc,$nn,bar,relief) $var($cc,$mm,bar,relief) - # update data set menu - $var(mb).graph.select add radiobutton -label "$var($cc,$nn,name)" \ - -variable ${varname}($cc,data,current) -value $nn \ - -command [list PlotCurrentData $varname] - # make current set var($cc,data,current) $nn PlotRestoreState $varname - PlotAddData $varname - $var(proc,updateelement) $varname - $var(proc,updategraph) $varname + PlotAddElement $varname PlotStats $varname PlotList $varname } |