ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
glh3c.C
Go to the documentation of this file.
1 // Display a 3D histogram using GL (box option).
2 //Author: Timur Pocheptsov
3 void glh3c()
4 {
6 
7 
9  TH3F * h1 = new TH3F("h1", "h1", 10, -1., 1., 10, -1., 1., 10, -1., 1.);
10  h1->FillRandom("gaus");
11  h1->SetFillColor(kRed);
12  TH3F * h2 = new TH3F("h2", "h2", 10, -1., 1., 10, -1., 1., 10, -1., 1.);
13  h2->FillRandom("landau");
14  h2->SetFillColor(kGreen);
15  TH3F * h3 = new TH3F("h3", "h3", 10, -1., 1., 10, -1., 1., 10, -1., 1.);
16  h3->FillRandom("gaus");
17  h3->SetFillColor(kBlue);
18 
19  comp->AddTH3(h1);
21  comp->AddTH3(h3);
22 
23  comp->Draw();
24 
25  TPaveLabel *title = new TPaveLabel(0.04, 0.86, 0.96, 0.98,
26  "TH3 composition.");
27  title->SetFillColor(32);
28  title->Draw();
29 }
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
Definition: TH3.cxx:653
3-D histogram with a float per channel (see TH1 documentation)}
Definition: TH3.h:272
Definition: Rtypes.h:61
R__EXTERN TStyle * gStyle
Definition: TStyle.h:423
Definition: Rtypes.h:61
void glh3c()
Definition: glh3c.C:3
TH2D * h2
Definition: fit2dHist.C:45
TH1F * h1
Definition: legend1.C:5
void SetCanvasPreferGL(Bool_t prefer=kTRUE)
Definition: TStyle.h:337
A Pave (see TPave) with a text centered in the Pave.
Definition: TPaveLabel.h:32
virtual void Draw(Option_t *option="")
Draw this histogram with options.
Definition: TH1.cxx:2878
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
virtual void SetFillColor(Color_t fcolor)
Definition: TAttFill.h:50
virtual void Draw(Option_t *option="")
Draw this pavelabel with its current attributes.
Definition: TPaveLabel.cxx:77
void AddTH3(const TH3 *hist, ETH3BinShape shape=kBox)
Add TH3 into collection.
Definition: Rtypes.h:61
const Bool_t kTRUE
Definition: Rtypes.h:91