Logo ROOT   6.12/07
Reference Guide
glh3c.C
Go to the documentation of this file.
1 /// \file
2 /// \ingroup tutorial_gl
3 /// Display a 3D histogram using GL (box option).
4 ///
5 /// \macro_image(nobatch)
6 /// \macro_code
7 ///
8 /// \author Timur Pocheptsov
9 
10 void glh3c()
11 {
13 
14 
16  TH3F * h1 = new TH3F("h1", "h1", 10, -1., 1., 10, -1., 1., 10, -1., 1.);
17  h1->FillRandom("gaus");
18  h1->SetFillColor(kRed);
19  TH3F * h2 = new TH3F("h2", "h2", 10, -1., 1., 10, -1., 1., 10, -1., 1.);
20  h2->FillRandom("landau");
21  h2->SetFillColor(kGreen);
22  TH3F * h3 = new TH3F("h3", "h3", 10, -1., 1., 10, -1., 1., 10, -1., 1.);
23  h3->FillRandom("gaus");
24  h3->SetFillColor(kBlue);
25 
26  comp->AddTH3(h1);
28  comp->AddTH3(h3);
29 
30  comp->Draw();
31 
32  TPaveLabel *title = new TPaveLabel(0.04, 0.86, 0.96, 0.98,
33  "TH3 composition.");
34  title->SetFillColor(32);
35  title->Draw();
36 }
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
Definition: TH3.cxx:658
3-D histogram with a float per channel (see TH1 documentation)}
Definition: TH3.h:267
Definition: Rtypes.h:59
R__EXTERN TStyle * gStyle
Definition: TStyle.h:402
Definition: Rtypes.h:59
TH1F * h1
Definition: legend1.C:5
void SetCanvasPreferGL(Bool_t prefer=kTRUE)
Definition: TStyle.h:316
A Pave (see TPave) with a text centered in the Pave.
Definition: TPaveLabel.h:20
virtual void Draw(Option_t *option="")
Draw this histogram with options.
Definition: TH1.cxx:2969
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition: TAttFill.h:37
virtual void Draw(Option_t *option="")
Draw this pavelabel with its current attributes.
Definition: TPaveLabel.cxx:77
THist< 3, float, THistStatContent, THistStatUncertainty > TH3F
Definition: THist.hxx:297
void AddTH3(const TH3 *hist, ETH3BinShape shape=kBox)
Add TH3 into collection.
Definition: Rtypes.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87