summaryrefslogtreecommitdiffstats
path: root/ds9/library
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2019-07-28 20:57:57 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2019-07-28 20:57:57 (GMT)
commitc036e6b48791752972bc6befea70b9b8e617ec55 (patch)
treef821e5a8ae7d088556017302dda7b251e4e0c6a2 /ds9/library
parentd92cbef747da994e4616b20da862176a3e272e17 (diff)
downloadblt-c036e6b48791752972bc6befea70b9b8e617ec55.zip
blt-c036e6b48791752972bc6befea70b9b8e617ec55.tar.gz
blt-c036e6b48791752972bc6befea70b9b8e617ec55.tar.bz2
support multiple graphs per plot
Diffstat (limited to 'ds9/library')
-rw-r--r--ds9/library/plot.tcl25
-rw-r--r--ds9/library/plotdialog.tcl28
-rw-r--r--ds9/library/plotstate.tcl3
3 files changed, 29 insertions, 27 deletions
diff --git a/ds9/library/plot.tcl b/ds9/library/plot.tcl
index 52ecf08..48c051a 100644
--- a/ds9/library/plot.tcl
+++ b/ds9/library/plot.tcl
@@ -427,13 +427,16 @@ proc PlotChangeAxis {varname} {
strip {
PlotUpdateCanvas $varname
set cc $var(graph,current)
+ set nn $var(graph,ds,current)
foreach gg $var(graphs) {
set var(graph,current) $gg
+ set var(graph,ds,current) [lindex $var($gg,dss) 0]
PlotRestoreState $varname
PlotUpdateGraph $varname
}
set var(graph,current) $cc
+ set var(graph,ds,current) $nn
PlotRestoreState $varname
}
}
@@ -445,13 +448,16 @@ proc PlotChangeLayout {varname} {
PlotUpdateCanvas $varname
set cc $var(graph,current)
+ set nn $var(graph,ds,current)
foreach gg $var(graphs) {
set var(graph,current) $gg
+ set var(graph,ds,current) [lindex $var($gg,dss) 0]
PlotRestoreState $varname
PlotUpdateGraph $varname
}
set var(graph,current) $cc
+ set var(graph,ds,current) $nn
PlotRestoreState $varname
PlotUpdateMenus $varname
@@ -637,13 +643,9 @@ proc PlotUpdateCanvas {varname} {
set var(layout,axis,x,min) 0
set var(layout,axis,x,max) 1
-
set var(layout,axis,x,grid) 1
set var(layout,axis,x,log) 0
set var(layout,axis,x,flip) 0
- set var(layout,axis,y,grid) 1
- set var(layout,axis,y,log) 0
- set var(layout,axis,y,flip) 0
}
strip {
set legendpos plotarea
@@ -663,13 +665,9 @@ proc PlotUpdateCanvas {varname} {
set var(layout,axis,x,min) $xmin
set var(layout,axis,x,max) $xmax
-
set var(layout,axis,x,grid) $var($first,axis,x,grid)
set var(layout,axis,x,log) $var($first,axis,x,log)
set var(layout,axis,x,flip) $var($first,axis,x,flip)
- set var(layout,axis,y,grid) $var($first,axis,y,grid)
- set var(layout,axis,y,log) $var($first,axis,y,log)
- set var(layout,axis,y,flip) $var($first,axis,y,flip)
}
}
@@ -783,18 +781,10 @@ proc PlotUpdateGraph {varname} {
set xgrid $var(graph,axis,x,grid)
set xlog $var(graph,axis,x,log)
set xflip $var(graph,axis,x,flip)
-
- set ygrid $var(graph,axis,y,grid)
- set ylog $var(graph,axis,y,log)
- set yflip $var(graph,axis,y,flip)
} else {
set xgrid $var(layout,axis,x,grid)
set xlog $var(layout,axis,x,log)
set xflip $var(layout,axis,x,flip)
-
- set ygrid $var(layout,axis,y,grid)
- set ylog $var(layout,axis,y,log)
- set yflip $var(layout,axis,y,flip)
}
if {$var(graph,format)} {
@@ -817,7 +807,8 @@ proc PlotUpdateGraph {varname} {
-min $xmin -max $xmax -descending $xflip -grid $xgrid -logscale $xlog
$var(graph) yaxis configure \
- -min $ymin -max $ymax -descending $yflip -grid $ygrid -logscale $ylog
+ -min $ymin -max $ymax -descending $var(graph,axis,y,flip) \
+ -grid $var(graph,axis,y,grid) -logscale $var(graph,axis,y,log)
if {$var(graph,axis,x,manage)} {
$var(graph) configure -plotpadx 0 -plotpady 0 -title $var(graph,title)
diff --git a/ds9/library/plotdialog.tcl b/ds9/library/plotdialog.tcl
index 7c422b4..485ea09 100644
--- a/ds9/library/plotdialog.tcl
+++ b/ds9/library/plotdialog.tcl
@@ -236,20 +236,20 @@ proc PlotDialog {varname wtt} {
$var(mb).graph.axes add checkbutton -label [msgcat::mc {X Grid}] \
-variable ${varname}(graph,axis,x,grid) \
-command [list PlotChangeAxis $varname]
- $var(mb).graph.axes add checkbutton -label [msgcat::mc {Log}] \
+ $var(mb).graph.axes add checkbutton -label [msgcat::mc {X Log}] \
-variable ${varname}(graph,axis,x,log) \
-command [list PlotChangeAxis $varname]
- $var(mb).graph.axes add checkbutton -label [msgcat::mc {Flip}] \
+ $var(mb).graph.axes add checkbutton -label [msgcat::mc {X Flip}] \
-variable ${varname}(graph,axis,x,flip) \
-command [list PlotChangeAxis $varname]
$var(mb).graph.axes add separator
$var(mb).graph.axes add checkbutton -label [msgcat::mc {Y Grid}] \
-variable ${varname}(graph,axis,y,grid) \
-command [list PlotChangeAxis $varname]
- $var(mb).graph.axes add checkbutton -label [msgcat::mc {Log}] \
+ $var(mb).graph.axes add checkbutton -label [msgcat::mc {Y Log}] \
-variable ${varname}(graph,axis,y,log) \
-command [list PlotChangeAxis $varname]
- $var(mb).graph.axes add checkbutton -label [msgcat::mc {Flip}] \
+ $var(mb).graph.axes add checkbutton -label [msgcat::mc {Y Flip}] \
-variable ${varname}(graph,axis,y,flip) \
-command [list PlotChangeAxis $varname]
$var(mb).graph.axes add separator
@@ -690,14 +690,28 @@ proc PlotUpdateMenus {varname} {
switch $var(layout) {
grid -
row -
- column {$var(mb).graph entryconfig [msgcat::mc {Axes}] -state normal}
+ column {
+ $var(mb).graph.axes entryconfig [msgcat::mc {X Grid}] -state normal
+ $var(mb).graph.axes entryconfig [msgcat::mc {X Log}] -state normal
+ $var(mb).graph.axes entryconfig [msgcat::mc {X Flip}] -state normal
+ }
strip {
set cc $var(graph,current)
set first [lindex $var(graphs) 0]
if {$cc == $first} {
- $var(mb).graph entryconfig [msgcat::mc {Axes}] -state normal
+ $var(mb).graph.axes entryconfig [msgcat::mc {X Grid}] \
+ -state normal
+ $var(mb).graph.axes entryconfig [msgcat::mc {X Log}] \
+ -state normal
+ $var(mb).graph.axes entryconfig [msgcat::mc {X Flip}] \
+ -state normal
} else {
- $var(mb).graph entryconfig [msgcat::mc {Axes}] -state disabled
+ $var(mb).graph.axes entryconfig [msgcat::mc {X Grid}] \
+ -state disabled
+ $var(mb).graph.axes entryconfig [msgcat::mc {X Log}] \
+ -state disabled
+ $var(mb).graph.axes entryconfig [msgcat::mc {X Flip}] \
+ -state disabled
}
}
}
diff --git a/ds9/library/plotstate.tcl b/ds9/library/plotstate.tcl
index abb6d43..d7fd277 100644
--- a/ds9/library/plotstate.tcl
+++ b/ds9/library/plotstate.tcl
@@ -16,9 +16,6 @@ proc PlotDefState {} {
set pap(layout,axis,x,grid) 0
set pap(layout,axis,x,log) 0
set pap(layout,axis,x,flip) 0
- set pap(layout,axis,y,grid) 0
- set pap(layout,axis,y,log) 0
- set pap(layout,axis,y,flip) 0
set pap(background) white
set pap(bar,mode) normal