From 0056598d0f225c387d99ccf94932fa247c144a2b Mon Sep 17 00:00:00 2001 From: William Joye Date: Sun, 21 Jul 2019 14:45:07 -0400 Subject: support multiple graphs per plot --- ds9/library/plot.tcl | 6 +++++- ds9/library/plotdialog.tcl | 12 ++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ds9/library/plot.tcl b/ds9/library/plot.tcl index fd2db2c..baa9c2f 100644 --- a/ds9/library/plot.tcl +++ b/ds9/library/plot.tcl @@ -549,7 +549,11 @@ proc PlotUpdateCanvas {varname} { PlotSaveState $varname foreach cc $var(graphs) { - $var($cc,graph) configure -barmode $var(bar,mode) + switch ($cc,type) { + line {} + bar {$var($cc,graph) configure -barmode $var(bar,mode)} + scatter {} + } $var($cc,graph) configure -plotpadx 0 -plotpady 0 \ -font "{$ds9($var(graph,title,family))} $var(graph,title,size) $var(graph,title,weight) $var(graph,title,slant)" \ diff --git a/ds9/library/plotdialog.tcl b/ds9/library/plotdialog.tcl index f73294e..133568e 100644 --- a/ds9/library/plotdialog.tcl +++ b/ds9/library/plotdialog.tcl @@ -693,13 +693,11 @@ proc PlotUpdateGraphMenu {varname} { global $varname if {[llength $var(graph,dss)] == 0} { - $var(mb) entryconfig [msgcat::mc {Data}] -state disabled $var(mb).graph entryconfig [msgcat::mc {Duplicate Dataset}] \ -state disabled $var(mb).graph entryconfig [msgcat::mc {Delete Dataset}] \ -state disabled } else { - $var(mb) entryconfig [msgcat::mc {Data}] -state normal $var(mb).graph entryconfig [msgcat::mc {Duplicate Dataset}] \ -state normal @@ -738,12 +736,18 @@ proc PlotUpdateDataMenu {varname} { bar { $var(mb) add cascade -label [msgcat::mc {Data}] \ -menu $var(mb).databar - $var(mb).graph entryconfig Mode -state normal + $var(mb).graph entryconfig [msgcat::mc {Mode}] -state normal } scatter { $var(mb) add cascade -label [msgcat::mc {Data}] \ -menu $var(mb).datascatter - $var(mb).graph entryconfig Mode -state disabled + $var(mb).graph entryconfig [msgcat::mc {Mode}] -state disabled } } + + if {[llength $var(graph,dss)] == 0} { + $var(mb) entryconfig [msgcat::mc {Data}] -state disabled + } else { + $var(mb) entryconfig [msgcat::mc {Data}] -state normal + } } -- cgit v0.12