diff -u -r1.261 THistPainter.cxx
--- histpainter/src/THistPainter.cxx	29 May 2006 13:28:58 -0000	1.261
+++ histpainter/src/THistPainter.cxx	12 Nov 2006 20:44:26 -0000
@@ -2288,7 +2288,12 @@
 }
 
 //______________________________________________________________________________
-void THistPainter::PaintColorLevels(Option_t *)
+#define HACK_NEGPOSHALFHALF 1
+void THistPainter::PaintColorLevels(Option_t *
+#ifdef HACK_NEGPOSHALFHALF
+                                    option
+#endif
+    )
 {
    // Control function to draw a table as a color plot.
    //
@@ -2306,7 +2311,29 @@
 
    Double_t zmin = fH->GetMinimum();
    Double_t zmax = fH->GetMaximum();
+#ifdef HACK_NEGPOSHALFHALF
+   Double_t zmin_real = zmin;
+   // draw negative values with first half, positive values with
+   // second half of palette
+   bool nphh = (strstr(option,"nphh")!=0);
+   if( nphh ) {
+       // find real minimum -- in logz mode, the minimum is forced to +1
+       // which makes the nphh option useless
+       fH->SetMinimum(-1111);
+       zmin_real = fH->GetMinimum();
+       fH->SetMinimum(zmin);
+       nphh = (zmin_real<0 && zmax>0);
+   }
+   if( nphh )
+       zmin = zmin_real;
+#endif
    if (Hoption.Logz) {
+#ifdef HACK_NEGPOSHALFHALF
+       if( nphh ) {
+           zmin = -TMath::Log10(-zmin);
+           zmax =  TMath::Log10( zmax);
+       } else
+#endif
       if (zmin > 0) {
          zmin = TMath::Log10(zmin);
          zmax = TMath::Log10(zmax);
@@ -2348,6 +2375,13 @@
          z     = fH->GetBinContent(bin);
          if (z == 0 && (zmin >= 0 || Hoption.Logz)) continue; // don't draw the empty bins for histograms with positive content
          if (Hoption.Logz) {
+#ifdef HACK_NEGPOSHALFHALF
+             if( nphh ) {
+                 if( z>1 )       z =  TMath::Log10( z);
+                 else if( z<-1 ) z = -TMath::Log10(-z);
+                 else z=0;
+             } else
+#endif
             if (z > 0) z = TMath::Log10(z);
             else       z = zmin;
          }
@@ -2379,6 +2413,18 @@
             if (yup  > gPad->GetUymax()) yup  = gPad->GetUymax();
          }
 
+#ifdef HACK_NEGPOSHALFHALF
+         if( nphh ) {
+             // set color to the color number *ndivz here to get the
+             // color number in theColor a few lines below
+             if( z<0 )
+                 color = Int_t( 0.01+(zmin-z)/zmin/2.0*Float_t(ndivz) );
+             else if( z>0 )
+                 color = Int_t( 0.01+(z/zmax+1)/2.0*Float_t(ndivz) );
+             else
+                 color = Int_t( Float_t(ndivz)/2.0 );
+         } else
+#endif
          if (fH->TestBit(TH1::kUserContour)) {
             zc = fH->GetContourLevelPad(0);
             if (z < zc) continue;

