Index: trunk/MagicSoft/Mars/mhcalib/MHGausEvents.cc
===================================================================
--- trunk/MagicSoft/Mars/mhcalib/MHGausEvents.cc	(revision 5004)
+++ trunk/MagicSoft/Mars/mhcalib/MHGausEvents.cc	(revision 5007)
@@ -386,5 +386,5 @@
   fPowerSpectrum     = fourier.PowerSpectrumDensity(&fEvents);
   fHPowerProbability = ProjectArray(*fPowerSpectrum, fPowerProbabilityBins,
-                                    Form("%s%s","PowerProbability",GetName()),
+                                    Form("%s%s","PowerProb",GetName()),
                                     "Probability of Power occurrance");
   fHPowerProbability->SetXTitle("P(f)");
@@ -521,46 +521,42 @@
 
   if (option.Contains("events"))
-    {
-      option.ReplaceAll("events","");
-      win += 1;
-    }
+    win += 1;
   if (option.Contains("fourier"))
-    {
-      option.ReplaceAll("fourier","");
-      win += 2;
-    }
-  
+    win += 2;
+  if (IsEmpty())
+    win--;
+
   pad->SetBorderMode(0);
   pad->Divide(1,win);
-  pad->cd(1);
-
-  if (!IsEmpty() && !IsOnlyOverflow() && !IsOnlyUnderflow())
-    gPad->SetLogy();
+
+  Int_t cwin = 1;
 
   gPad->SetTicks();
 
-  fHGausHist.Draw(option);
-
-  if (fFGausFit)
-    {
-      fFGausFit->SetLineColor(IsGausFitOK() ? kGreen : kRed);
-      fFGausFit->Draw("same");
-    }
-  switch (win)
-    {
-    case 2:
-      pad->cd(2);
+  if (!IsEmpty())
+    {
+      pad->cd(cwin++);
+
+      if (!IsOnlyOverflow() && !IsOnlyUnderflow())
+        gPad->SetLogy();
+
+      fHGausHist.Draw(option);
+      
+      if (fFGausFit)
+        {
+          fFGausFit->SetLineColor(IsGausFitOK() ? kGreen : kRed);
+          fFGausFit->Draw("same");
+        }
+    }
+  
+  if (option.Contains("events"))
+    {
+      pad->cd(cwin++);
       DrawEvents();
-      break;
-    case 3:
-      pad->cd(2);
-      DrawPowerSpectrum(*pad,3);
-      break;
-    case 4:
-      pad->cd(2);
-      DrawEvents();
-      pad->cd(3);
-      DrawPowerSpectrum(*pad,4);
-      break;
+    }
+  if (option.Contains("fourier"))      
+    {
+      pad->cd(cwin++);
+      DrawPowerSpectrum(*pad,cwin);
     }
 }
