From $ROOTSYS/tutorials/hist/reverseaxis.C

// Example showing an histogram with reverse axis.
//Author: Olivier Couet

void reverseaxis ()
{
   TH2F *hpxpy  = new TH2F("hpxpy","py vs px",40,-4,4,40,-4,4);
   Float_t px, py;
   TRandom r;
   for (Int_t i = 0; i < 25000; i++) {
      r.Rannor(px,py);
      hpxpy->Fill(px,py);
   }
   TCanvas *c1 = new TCanvas("c1");
   hpxpy->Draw("colz");
   ReverseXAxis(hpxpy);
   ReverseYAxis(hpxpy);
}

void ReverseXAxis (TH1 *h)
{
   // Remove the current axis
   h->GetXaxis()->SetLabelOffset(999);
   h->GetXaxis()->SetTickLength(0);

   // Redraw the new axis 
   gPad->Update();
   TGaxis *newaxis = new TGaxis(gPad->GetUxmax(), 
                                gPad->GetUymin(),
                                gPad->GetUxmin(),
                                gPad->GetUymin(),
                                h->GetXaxis()->GetXmin(),
                                h->GetXaxis()->GetXmax(),
                                510,"-");
   newaxis->SetLabelOffset(-0.03);
   newaxis->Draw();
}

void ReverseYAxis (TH1 *h)
{
   // Remove the current axis
   h->GetYaxis()->SetLabelOffset(999);
   h->GetYaxis()->SetTickLength(0);

   // Redraw the new axis 
   gPad->Update();
   TGaxis *newaxis = new TGaxis(gPad->GetUxmin(), 
                                gPad->GetUymax(),
                                gPad->GetUxmin()-0.001,
                                gPad->GetUymin(),
                                h->GetYaxis()->GetXmin(),
                                h->GetYaxis()->GetXmax(),
                                510,"+");
   newaxis->SetLabelOffset(-0.03);
   newaxis->Draw();
}
 reverseaxis.C:1
 reverseaxis.C:2
 reverseaxis.C:3
 reverseaxis.C:4
 reverseaxis.C:5
 reverseaxis.C:6
 reverseaxis.C:7
 reverseaxis.C:8
 reverseaxis.C:9
 reverseaxis.C:10
 reverseaxis.C:11
 reverseaxis.C:12
 reverseaxis.C:13
 reverseaxis.C:14
 reverseaxis.C:15
 reverseaxis.C:16
 reverseaxis.C:17
 reverseaxis.C:18
 reverseaxis.C:19
 reverseaxis.C:20
 reverseaxis.C:21
 reverseaxis.C:22
 reverseaxis.C:23
 reverseaxis.C:24
 reverseaxis.C:25
 reverseaxis.C:26
 reverseaxis.C:27
 reverseaxis.C:28
 reverseaxis.C:29
 reverseaxis.C:30
 reverseaxis.C:31
 reverseaxis.C:32
 reverseaxis.C:33
 reverseaxis.C:34
 reverseaxis.C:35
 reverseaxis.C:36
 reverseaxis.C:37
 reverseaxis.C:38
 reverseaxis.C:39
 reverseaxis.C:40
 reverseaxis.C:41
 reverseaxis.C:42
 reverseaxis.C:43
 reverseaxis.C:44
 reverseaxis.C:45
 reverseaxis.C:46
 reverseaxis.C:47
 reverseaxis.C:48
 reverseaxis.C:49
 reverseaxis.C:50
 reverseaxis.C:51
 reverseaxis.C:52
 reverseaxis.C:53
 reverseaxis.C:54
 reverseaxis.C:55
 reverseaxis.C:56