Index: trunk/tools/czartool/Plotter.pm
===================================================================
--- trunk/tools/czartool/Plotter.pm	(revision 30955)
+++ trunk/tools/czartool/Plotter.pm	(revision 31886)
@@ -97,16 +97,4 @@
     my $type = $isLog ? "log" : "linear";
     return $prefix . "/czarplot_" . $type . "_" . $label . "_" . $stagePart . "_$suffix.png";
-}
-
-###########################################################################
-#
-# Plots a time series for all stages for this label, both log and linear
-#
-###########################################################################
-sub createLogAndLinearTimeSeries {
-    my ($self, $label, $selectedStage, $beginTime, $endTime) = @_;
-
-    $self->createTimeSeries($label, $selectedStage, $beginTime, $endTime, 1);
-    $self->createTimeSeries($label, $selectedStage, $beginTime, $endTime, 0);
 }
 
@@ -146,6 +134,6 @@
 #
 ###########################################################################
-sub createRatePlot {
-    my ($self, $label, $selectedStage, $beginTime, $endTime, $interval, $histogram, $timeSeries) = @_;
+sub createRateHistogram {
+    my ($self, $label, $selectedStage, $beginTime, $endTime, $interval) = @_;
 
     # stages
@@ -184,14 +172,6 @@
     }
 
-    if ($histogram) {
-
-        my $outputFile = createImageFileName($self, $label, $selectedStage, "rh", 0);
-        $self->plotRateStackedHistogram(\%gnuplotFiles, $outputFile, $label, $selectedStage, $beginTime, $endTime, $interval);
-    }
-    if ($timeSeries) {
-
-        my $outputFile = createImageFileName($self, $label, $selectedStage, "rt", 0);
-        $self->plotTimeSeries(\%gnuplotFiles, $outputFile, $label, $beginTime, $endTime, $maxX, $minX, $timeDiff, "", "Exposures processed per $interval");
-    }
+    my $outputFile = createImageFileName($self, $label, $selectedStage, "rh", 0);
+    $self->plotRateStackedHistogram(\%gnuplotFiles, $outputFile, $label, $selectedStage, $beginTime, $endTime, $interval);
 
     # now delete temp dat files
@@ -250,5 +230,5 @@
 ###########################################################################
 sub createTimeSeries {
-    my ($self, $label, $selectedStage, $beginTime, $endTime, $isLog, $showCleanup, $deriv) = @_;
+    my ($self, $label, $selectedStage, $beginTime, $endTime, $linear, $log, $rate) = @_;
 
     my $minX = 999999999;      
@@ -261,7 +241,12 @@
     else {$stages = ["$selectedStage"]};        
 
-    my %gnuplotFiles;
+    my %linDataFiles;
+    my %logDataFiles;
+    my %ratDataFiles;
     my $stage = undef;
-    my $gnuplotFile = undef;
+    my $linDataFile = undef;
+    my $logDataFile = undef;
+    my $ratDataFile = undef;
+
     foreach $stage (@{$stages}) {
 
@@ -274,14 +259,15 @@
                     \$maxX, 
                     \$timeDiff, 
-                    \$gnuplotFile,
-                    $isLog,
-                    $showCleanup,
-                    $deriv)) {
-
-            $gnuplotFiles{$stage} = $gnuplotFile;
+                    \$linDataFile,
+                    \$logDataFile,
+                    \$ratDataFile)) {
+
+            $linDataFiles{$stage} = $linDataFile;
+            $logDataFiles{$stage} = $logDataFile;
+            $ratDataFiles{$stage} = $ratDataFile;
         }
     }                                                           
 
-    my $numOfPlots =  keys(%gnuplotFiles);
+    my $numOfPlots =  keys(%linDataFiles);
 
     if ($numOfPlots == 0 ) {
@@ -297,21 +283,55 @@
     }
 
-    my $outputFile = createImageFileName($self, $label, $selectedStage, "t", $isLog);
-    my $yTitle;
-    if ($isLog) {$yTitle = "Log(Exposures)";}
-    elsif ($deriv) {$yTitle = "dExposures/dTime(secs)";}
-    else {$yTitle = "Exposures";}
-    $self->plotTimeSeries(
-            \%gnuplotFiles, 
-            $outputFile, 
-            $label, 
-            $beginTime, 
-            $endTime, 
-            $maxX, 
-            $minX, 
-            $timeDiff, 
-            "",
-            $yTitle);
-}                                                    
+    if ($linear) {
+
+        my $outputFile = createImageFileName($self, $label, $selectedStage, "t", 0);
+
+        $self->plotTimeSeries(
+                \%linDataFiles, 
+                $outputFile, 
+                $label, 
+                $beginTime, 
+                $endTime, 
+                $maxX, 
+                $minX, 
+                $timeDiff, 
+                "",
+                "Exposures");
+    }
+
+    if ($log) {
+
+        my $outputFile = createImageFileName($self, $label, $selectedStage, "t", 1);
+
+        $self->plotTimeSeries(
+                \%logDataFiles, 
+                $outputFile, 
+                $label, 
+                $beginTime, 
+                $endTime, 
+                $maxX, 
+                $minX, 
+                $timeDiff, 
+                "",
+                "Log(Exposures)");
+    }
+
+    if ($rate) {
+
+        my $outputFile = createImageFileName($self, $label, $selectedStage, "rt", 0);
+
+        $self->plotTimeSeries(
+                \%ratDataFiles, 
+                $outputFile, 
+                $label, 
+                $beginTime, 
+                $endTime, 
+                $maxX, 
+                $minX, 
+                $timeDiff, 
+                "",
+                "Exposures processed per hour");
+}    
+}                                                
 
 ###########################################################################
@@ -468,8 +488,4 @@
     my $timeFormat = undef;
     my $divX = undef;
-    #my $yTitle = undef;
-    #if ($isLog) {$yTitle = "Log( Exposures )";}
-    #elsif ($isDeriv) {$yTitle = "dExposures/dTime(secs)";}
-    #else {$yTitle = "Exposures";}
 
     $self->getTimeSpacing($timeDiff, \$divX, \$timeFormat);
@@ -478,6 +494,4 @@
 
     # sort out plot title
-    #my $title = "";
-    #if ($isDeriv) {$title .= "First derivatives of "}
     if ($numOfPlots == 1) {foreach my $stage (keys %$gnuplotFiles) {$title .= "'".$stage."'";}}
     else {$title .= "'all stages'"}
