swh:1:snp:af87cd67498ef4fe47c76ed3e7caffe5b61facaf
Raw File
Tip revision: 59fe6578eda8d4c55e125a80e956ef4431ab5322 authored by Pere Mato on 04 March 2016, 14:47:28 UTC
Update ROOT version files to v6.07/04.
Tip revision: 59fe657
th2polyHoneycomb.C
/// \file
/// \ingroup tutorial_hist
/// This tutorial illustrates how to create an histogram with hexagonal
/// bins (TH2Poly), fill it and draw it using GL.
///
/// \macro_code
///
/// \author  Olivier Couet

void th2polyHoneycomb(){
   gStyle->SetCanvasPreferGL(true);
   TH2Poly *hc = new TH2Poly();
   hc->Honeycomb(0,0,.1,25,25);
   gStyle->SetPalette(1);

   TRandom ran;
   for (int i = 0; i<30000; i++) {
      hc->Fill(ran.Gaus(2.,1), ran.Gaus(2.,1));
   }

   hc->Draw("gllego");
}
back to top