Logo ROOT  
Reference Guide
glh3c.C File Reference

Detailed Description

Display a 3D histogram using GL (box option).

void glh3c()
{
TH3F * h1 = new TH3F("h1", "h1", 10, -1., 1., 10, -1., 1., 10, -1., 1.);
TF3 * g3 = new TF3("gaus3","xyzgaus");
g3->SetParameters(1,0,1,0,1,0,1);
h1->FillRandom("gaus3");
TH3F * h2 = new TH3F("h2", "h2", 10, -1., 1., 10, -1., 1., 10, -1., 1.);
TF3 * l3 = new TF3("landau3","landau(x,[0],[1],[2])*gaus(y,1,[3],[4])*gaus(z,1,[3],[4])");
l3->SetParameters(1,0,1,0.,0.5);
h2->FillRandom("landau3");
TH3F * h3 = new TH3F("h3", "h3", 10, -1., 1., 10, -1., 1., 10, -1., 1.);
TF3 * gx = new TF3("gaus1","gaus(x)");
gx->SetParameters(1,0,1);
h3->FillRandom("gaus1");
comp->AddTH3(h1);
comp->AddTH3(h3);
comp->Draw();
TPaveLabel *title = new TPaveLabel(0.04, 0.86, 0.96, 0.98,
"TH3 composition.");
title->SetFillColor(32);
title->Draw();
}
Author
Timur Pocheptsov

Definition in file glh3c.C.

TStyle::SetCanvasPreferGL
void SetCanvasPreferGL(Bool_t prefer=kTRUE)
Definition: TStyle.h:325
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
kGreen
@ kGreen
Definition: Rtypes.h:66
TH3::FillRandom
virtual void FillRandom(const char *fname, Int_t ntimes=5000, TRandom *rng=nullptr)
Fill histogram following distribution in function fname.
Definition: TH3.cxx:742
TGLTH3Composition
Definition: TGLTH3Composition.h:27
TH1::FillRandom
virtual void FillRandom(const char *fname, Int_t ntimes=5000, TRandom *rng=nullptr)
Fill histogram following distribution in function fname.
Definition: TH1.cxx:3502
TPaveLabel::Draw
virtual void Draw(Option_t *option="")
Draw this pavelabel with its current attributes.
Definition: TPaveLabel.cxx:77
h1
TH1F * h1
Definition: legend1.C:5
TF1::SetParameters
virtual void SetParameters(const Double_t *params)
Definition: TF1.h:643
gStyle
R__EXTERN TStyle * gStyle
Definition: TStyle.h:412
TF3
A 3-Dim function with parameters.
Definition: TF3.h:28
kRed
@ kRed
Definition: Rtypes.h:66
TGLTH3Composition::AddTH3
void AddTH3(const TH3 *hist, ETH3BinShape shape=kBox)
Add TH3 into collection.
Definition: TGLTH3Composition.cxx:41
TH3F
3-D histogram with a float per channel (see TH1 documentation)}
Definition: TH3.h:268
TPaveLabel
A Pave (see TPave) with a text centered in the Pave.
Definition: TPaveLabel.h:20
TAttFill::SetFillColor
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition: TAttFill.h:37
kBlue
@ kBlue
Definition: Rtypes.h:66
TGLTH3Composition::kSphere
@ kSphere
Definition: TGLTH3Composition.h:34
TH1::Draw
virtual void Draw(Option_t *option="")
Draw this histogram with options.
Definition: TH1.cxx:3050