summaryrefslogtreecommitdiffstats
path: root/ds9
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2019-06-27 18:20:09 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2019-06-27 18:20:09 (GMT)
commitf5190161813d34fbcf2728f491d14454068b88b6 (patch)
treeea90f091fc35e5fc4f49ce9c611a0489a73adb2f /ds9
parentd376cd8ca9710c393bbdf99adf652d8a8d103233 (diff)
downloadblt-f5190161813d34fbcf2728f491d14454068b88b6.zip
blt-f5190161813d34fbcf2728f491d14454068b88b6.tar.gz
blt-f5190161813d34fbcf2728f491d14454068b88b6.tar.bz2
support multiple graph plots
Diffstat (limited to 'ds9')
-rw-r--r--ds9/library/plot.tcl17
-rw-r--r--ds9/library/plotbar.tcl2
-rw-r--r--ds9/library/plotdata.tcl2
-rw-r--r--ds9/library/plotline.tcl2
-rw-r--r--ds9/library/plotprocess.tcl2
-rw-r--r--ds9/library/plotscatter.tcl2
-rw-r--r--ds9/library/plotstate.tcl13
7 files changed, 19 insertions, 21 deletions
diff --git a/ds9/library/plot.tcl b/ds9/library/plot.tcl
index 095b4cc..f1c2cbb 100644
--- a/ds9/library/plot.tcl
+++ b/ds9/library/plot.tcl
@@ -151,13 +151,14 @@ proc PlotDeleteGraph {varname cc} {
# set current graph
set var(graph,current) [lindex $var(graphs) 0]
PlotRestoreState $varname
- PlotStats $varname
- PlotList $varname
# update menus
$var(proc,updateelement) $varname
$var(proc,updategraph) $varname
$var(proc,updatecanvas) $varname
+
+ PlotStats $varname
+ PlotList $varname
}
# Data
@@ -223,7 +224,7 @@ proc PlotDeleteDataSet {varname} {
global $varname
set cc $var(graph,current)
- set nn $var($cc,ds,current)
+ set nn $var(graph,ds,current)
if {[llength $var($cc,dss)] == 0} {
return
@@ -262,7 +263,7 @@ proc PlotDeleteDataSet {varname} {
}
# set current dataset
- set var($cc,ds,current) [lindex $var($cc,dss) 0]
+ set var(graph,ds,current) [lindex $var($cc,dss) 0]
PlotRestoreState $varname
# update menus
@@ -325,8 +326,8 @@ proc PlotExternal {varname} {
incr ${varname}($cc,seq)
set nn $var($cc,seq)
lappend var($cc,dss) $nn
- set var($cc,ds,current) $nn
+ set var(graph,ds,current) $nn
set var(graph,ds,manage) 0
set var(graph,ds,name) "Dataset $nn"
@@ -645,9 +646,9 @@ proc PlotBackup {ch dir} {
strip {puts $ch "PlotStripTool"}
}
- set save $var($cc,ds,current)
+ set save $var(graph,ds,current)
foreach nn $var($cc,dss) {
- set ${varname}($cc,ds,current) $nn
+ set ${varname}(graph,ds,current) $nn
PlotCurrentDataSet $varname
PlotSaveDataFile $varname "$fdir/plot$nn.dat"
@@ -656,7 +657,7 @@ proc PlotBackup {ch dir} {
puts $ch "PlotLoadDataFile $varname $fdir/plot$nn.dat $var($cc,$nn,dim)"
puts $ch "PlotLoadConfigFile $varname $fdir/plot$nn.plt"
}
- set ${varname}($cc,ds,current) $save
+ set ${varname}(graph,ds,current) $save
PlotCurrentDataSet $varname
}
}
diff --git a/ds9/library/plotbar.tcl b/ds9/library/plotbar.tcl
index 38c65de..3d23936 100644
--- a/ds9/library/plotbar.tcl
+++ b/ds9/library/plotbar.tcl
@@ -173,7 +173,7 @@ proc PlotBarUpdateElement {varname} {
set cap 0
}
- set nn $var($cc,ds,current)
+ set nn $var(graph,ds,current)
$var(graph) element configure ${nn} \
-label $var(graph,ds,name) -hide [expr !$var(graph,ds,show)] \
-relief $var(graph,ds,bar,relief) -color $var(graph,ds,color) \
diff --git a/ds9/library/plotdata.tcl b/ds9/library/plotdata.tcl
index e984738..93a4be1 100644
--- a/ds9/library/plotdata.tcl
+++ b/ds9/library/plotdata.tcl
@@ -302,7 +302,7 @@ proc PlotDupDataSet {varname mm} {
set var($cc,$nn,bar,relief) $var($cc,$mm,bar,relief)
# make current
- set var($cc,ds,current) $nn
+ set var(graph,ds,current) $nn
PlotAddElement $varname
diff --git a/ds9/library/plotline.tcl b/ds9/library/plotline.tcl
index 6ac8d3c..f03f6f5 100644
--- a/ds9/library/plotline.tcl
+++ b/ds9/library/plotline.tcl
@@ -191,7 +191,7 @@ proc PlotLineUpdateElement {varname} {
set cap 0
}
- set nn $var($cc,ds,current)
+ set nn $var(graph,ds,current)
$var(graph) element configure ${nn} \
-label $var(graph,ds,name) -hide [expr !$var(graph,ds,show)] \
-symbol $var(graph,ds,shape,symbol) -fill $clr -scalesymbols no \
diff --git a/ds9/library/plotprocess.tcl b/ds9/library/plotprocess.tcl
index d4621fe..99bb60b 100644
--- a/ds9/library/plotprocess.tcl
+++ b/ds9/library/plotprocess.tcl
@@ -340,7 +340,7 @@ proc PlotCmdSelectData {which} {
upvar #0 $cvarname cvar
set cc $cvar(graph,current)
- set cvar($cc,ds,current) $which
+ set cvar(graph,ds,current) $which
PlotCurrentDataSet $cvarname
}
diff --git a/ds9/library/plotscatter.tcl b/ds9/library/plotscatter.tcl
index 80e29e9..7867ff9 100644
--- a/ds9/library/plotscatter.tcl
+++ b/ds9/library/plotscatter.tcl
@@ -113,7 +113,7 @@ proc PlotScatterUpdateElement {varname} {
set cap 0
}
- set nn $var($cc,ds,current)
+ set nn $var(graph,ds,current)
$var(graph) element configure ${nn} \
-label $var(graph,ds,name) -hide [expr !$var(graph,ds,show)] \
-symbol $var(graph,ds,shape,symbol) -fill $clr -scalesymbols no \
diff --git a/ds9/library/plotstate.tcl b/ds9/library/plotstate.tcl
index ce7d950..f675e8b 100644
--- a/ds9/library/plotstate.tcl
+++ b/ds9/library/plotstate.tcl
@@ -88,6 +88,7 @@ proc PlotInitGraph {varname} {
# per Graph
set cc $var(graph,current)
+ set var(graph,ds,current) {}
set var(graph) $var(canvas).$cc
set var(graph,name) "Graph $var(seq)"
@@ -96,7 +97,6 @@ proc PlotInitGraph {varname} {
set var(graph,seq) 0
set var(graph,dss) {}
- set var(graph,ds,current) {}
set var(graph,legend) $pap(graph,legend)
set var(graph,legend,title) $pap(graph,legend,title)
@@ -158,6 +158,7 @@ proc PlotSaveState {varname} {
# per Graph
set cc $var(graph,current)
+ set nn $var(graph,ds,current)
set var($cc) $var(graph)
set var($cc,name) $var(graph,name)
@@ -166,7 +167,6 @@ proc PlotSaveState {varname} {
set var($cc,seq) $var(graph,seq)
set var($cc,dss) $var(graph,dss)
- set var($cc,ds,current) $var(graph,ds,current)
set var($cc,legend) $var(graph,legend)
set var($cc,legend,title) $var(graph,legend,title)
@@ -191,8 +191,6 @@ proc PlotSaveState {varname} {
set var($cc,axis,y,format) $var(graph,axis,y,format)
# per DataSet
- set nn $var(graph,ds,current)
-
set var($cc,$nn,name) $var(graph,ds,name)
set var($cc,$nn,dim) $var(graph,ds,dim)
set var($cc,$nn,manage) $var(graph,ds,manage)
@@ -226,8 +224,11 @@ proc PlotRestoreState {varname} {
upvar #0 $varname var
global $varname
+ puts "RestoreState $var(graph,current) $var(graph,ds,current)"
+
# per Graph
set cc $var(graph,current)
+ set nn $var(graph,ds,current)
set var(graph) $var($cc)
set var(graph,name) $var($cc,name)
@@ -236,7 +237,6 @@ proc PlotRestoreState {varname} {
set var(graph,seq) $var($cc,seq)
set var(graph,dss) $var($cc,dss)
- set var(graph,ds,current) $var($cc,ds,current)
set var(graph,legend) $var($cc,legend)
set var(graph,legend,title) $var($cc,legend,title)
@@ -261,9 +261,6 @@ proc PlotRestoreState {varname} {
set var(graph,axis,y,format) $var($cc,axis,y,format)
# per DataSet
- set nn $var($cc,ds,current)
- puts "RestoreState $cc $nn"
-
set var(graph,ds,name) $var($cc,$nn,name)
set var(graph,ds,dim) $var($cc,$nn,dim)
set var(graph,ds,manage) $var($cc,$nn,manage)