th2polyHoneycomb.C

Go to the documentation of this file.
00001 //This tutorial illustrates how to create an histogram with hexagonal
00002 //bins (TH2Poly), fill it and draw it using GL. 
00003 //
00004 //Author: Olivier Couet
00005 
00006 void th2polyHoneycomb(){
00007    gStyle->SetCanvasPreferGL(true);
00008    TH2Poly *hc = new TH2Poly();
00009    hc->Honeycomb(0,0,.1,25,25);
00010    gStyle->SetPalette(1);
00011 
00012    TRandom ran;
00013    for (int i = 0; i<30000; i++) {
00014       hc->Fill(ran.Gaus(2.,1), ran.Gaus(2.,1));
00015    }
00016 
00017    hc->Draw("gllego");
00018 }

Generated on Tue Jul 5 15:44:29 2011 for ROOT_528-00b_version by  doxygen 1.5.1