summaryrefslogtreecommitdiffstats
path: root/ds9
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2019-05-28 15:40:37 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2019-05-28 15:40:37 (GMT)
commit7096765937a555346816dc072435ca2dda2f903a (patch)
tree9055e0f6770fa9170d22b6f4e06c0bdf8ae06770 /ds9
parent6e111475be533c11d75c353f1c8b9be14a611283 (diff)
downloadblt-7096765937a555346816dc072435ca2dda2f903a.zip
blt-7096765937a555346816dc072435ca2dda2f903a.tar.gz
blt-7096765937a555346816dc072435ca2dda2f903a.tar.bz2
add multiple plot support
Diffstat (limited to 'ds9')
-rw-r--r--ds9/library/plot.tcl34
-rw-r--r--ds9/library/plotdialog.tcl60
2 files changed, 26 insertions, 68 deletions
diff --git a/ds9/library/plot.tcl b/ds9/library/plot.tcl
index aad4c12..bac0ba8 100644
--- a/ds9/library/plot.tcl
+++ b/ds9/library/plot.tcl
@@ -1030,6 +1030,9 @@ proc PlotSaveConfigFile {varname filename} {
upvar #0 $varname var
global $varname
+ set tt $var(graph,total)
+ set cc $var(graph,current)
+
if {$filename == {}} {
return
}
@@ -1084,21 +1087,22 @@ proc PlotSaveConfigFile {varname filename} {
set analysisplot(axis,font,weight) $var(axis,font,weight)
set analysisplot(axis,font,slant) $var(axis,font,slant)
- set analysisplot(show) $var(show)
- set analysisplot(shape,symbol) $var(shape,symbol)
- set analysisplot(shape,fill) $var(shape,fill)
- set analysisplot(shape,color) $var(shape,color)
- set analysisplot(smooth) $var(smooth)
- set analysisplot(color) $var(color)
- set analysisplot(fill) $var(fill)
- set analysisplot(fill,color) $var(fill,color)
- set analysisplot(width) $var(width)
- set analysisplot(dash) $var(dash)
-
- set analysisplot(error) $var(error)
- set analysisplot(error,cap) $var(error,cap)
- set analysisplot(error,color) $var(error,color)
- set analysisplot(error,width) $var(error,width)
+ set analysisplot(show) $var(graph$cc,show)
+ set analysisplot(smooth) $var(graph$cc,smooth)
+ set analysisplot(color) $var(graph$cc,color)
+ set analysisplot(fill) $var(graph$cc,fill)
+ set analysisplot(fill,color) $var(graph$cc,fill,color)
+ set analysisplot(width) $var(graph$cc,width)
+ set analysisplot(dash) $var(graph$cc,dash)
+
+ set analysisplot(shape,symbol) $var(graph$cc,shape,symbol)
+ set analysisplot(shape,fill) $var(graph$cc,shape,fill)
+ set analysisplot(shape,color) $var(graph$cc,shape,color)
+
+ set analysisplot(error) $var(graph$cc,error)
+ set analysisplot(error,cap) $var(graph$cc,error,cap)
+ set analysisplot(error,color) $var(graph$cc,error,color)
+ set analysisplot(error,width) $var(graph$cc,error,width)
set analysisplot(bar,relief) $var(bar,relief)
set analysisplot(bar,mode) $var(bar,mode)
diff --git a/ds9/library/plotdialog.tcl b/ds9/library/plotdialog.tcl
index 45fd2e1..a9ca4fd 100644
--- a/ds9/library/plotdialog.tcl
+++ b/ds9/library/plotdialog.tcl
@@ -134,9 +134,6 @@ proc PlotDialog {varname wtt title xaxis yaxis} {
-menu $var(mb).canvas.font
$var(mb).canvas add cascade -label [msgcat::mc {Background}] \
-menu $var(mb).canvas.bg
- $var(mb).canvas add separator
- $var(mb).canvas add command -label "[msgcat::mc {Title}]..." \
- -command [list PlotGraphTitleDialog $varname]
menu $var(mb).canvas.font
$var(mb).canvas.font add cascade -label [msgcat::mc {Title}] \
@@ -172,7 +169,7 @@ proc PlotDialog {varname wtt title xaxis yaxis} {
-menu $var(mb).graph.legend
$var(mb).graph add separator
$var(mb).graph add command -label "[msgcat::mc {Titles}]..." \
- -command [list PlotPlotTitleDialog $varname]
+ -command [list PlotGraphTitleDialog $varname]
menu $var(mb).graph.axes
$var(mb).graph.axes add checkbutton -label [msgcat::mc {X Grid}] \
@@ -365,57 +362,10 @@ proc PlotGraphTitleDialog {varname} {
global $varname
global ed
- set w {.apgraphtitle}
-
- set ed(ok) 0
- set ed(graph,title) $var(graph,title)
-
- DialogCreate $w [msgcat::mc {Title}] ed(ok)
-
- # Param
- set f [ttk::frame $w.param]
- ttk::label $f.label -text [msgcat::mc {Title}]
- ttk::entry $f.title -textvariable ed(graph,title) -width 30
-
- grid $f.label $f.title -padx 2 -pady 2 -sticky ew
- grid columnconfigure $f 1 -weight 1
-
- # Buttons
- set f [ttk::frame $w.buttons]
- ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
- -default active
- ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
- pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
-
- bind $w <Return> {set ed(ok) 1}
-
- # Fini
- ttk::separator $w.sep -orient horizontal
- pack $w.buttons $w.sep -side bottom -fill x
- pack $w.param -side top -fill both -expand true
-
- DialogCenter $w
- DialogWait $w ed(ok) $w.param.title
- DialogDismiss $w
-
- if {$ed(ok)} {
- set var(graph,title) $ed(graph,title)
- $var(proc,updategraph) $varname
- }
-
- set rr $ed(ok)
- unset ed
- return $rr
-}
-
-proc PlotPlotTitleDialog {varname} {
- upvar #0 $varname var
- global $varname
- global ed
-
set w {.applottitle}
set ed(ok) 0
+ set ed(graph,title) $var(graph,title)
set ed(axis,x,title) $var(axis,x,title)
set ed(axis,y,title) $var(axis,y,title)
set ed(legend,title) $var(legend,title)
@@ -424,6 +374,8 @@ proc PlotPlotTitleDialog {varname} {
# Param
set f [ttk::frame $w.param]
+ ttk::label $f.label -text [msgcat::mc {Title}]
+ ttk::entry $f.title -textvariable ed(graph,title) -width 30
ttk::label $f.xlabel -text [msgcat::mc {X Axis Title}]
ttk::entry $f.xtitle -textvariable ed(axis,x,title) -width 30
ttk::label $f.ylabel -text [msgcat::mc {Y Axis Title}]
@@ -431,6 +383,7 @@ proc PlotPlotTitleDialog {varname} {
ttk::label $f.legendlabel -text [msgcat::mc {Legend Title}]
ttk::entry $f.legendtitle -textvariable ed(legend,title) -width 30
+ grid $f.label $f.title -padx 2 -pady 2 -sticky ew
grid $f.xlabel $f.xtitle -padx 2 -pady 2 -sticky ew
grid $f.ylabel $f.ytitle -padx 2 -pady 2 -sticky ew
grid $f.legendlabel $f.legendtitle -padx 2 -pady 2 -sticky ew
@@ -451,10 +404,11 @@ proc PlotPlotTitleDialog {varname} {
pack $w.param -side top -fill both -expand true
DialogCenter $w
- DialogWait $w ed(ok) $w.param.xtitle
+ DialogWait $w ed(ok) $w.param.title
DialogDismiss $w
if {$ed(ok)} {
+ set var(graph,title) $ed(graph,title)
set var(axis,x,title) $ed(axis,x,title)
set var(axis,y,title) $ed(axis,y,title)
set var(legend,title) $ed(legend,title)