Color of Bins

From: OKUMURA, Akira <oxon_at_icrr.u-tokyo.ac.jp>
Date: Thu, 8 Nov 2007 11:56:07 -1000


Hello ROOTers,

I have a TH2 histogram which is like a world map. X is longitude, and Y is latitude. I would like to change the shape of the histogram using Mollweide projection. TPolyLine will be used to draw each projected bin.

My question is:
I would like to retrieve the color of each bin. For example,

TH2F* hist = new ....
for(int i=0; i<hist->GetNbinsX(); i++){

   for(int j=0; j<hist->GetNbinsY(); j++){

     int col = hist->GetBinColor(i+1, j+1); // <= any idea?
     TPolyLine* pol = new TPolyLine;
     ......
     pol->SetFillColor(col);
     pol->Draw("f");

   }
}

How can I do like this?

Sincerely

OKUMURA, Akira oxon_at_icrr.u-tokyo.ac.jp
Institute for Cosmic Ray Research, University of Tokyo 5-1-5 Kashiwanoha Kashiwa Chiba 277-8582 Japan Phone/Fax : +81 4-7136-3153
Skype : okumura.akira Received on Thu Nov 08 2007 - 22:56:59 CET

This archive was generated by hypermail 2.2.0 : Thu Nov 08 2007 - 23:50:01 CET