Logo ROOT  
Reference Guide
glbox.C File Reference

Detailed Description

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

void glbox()
{
TCanvas *c = new TCanvas("glbox","TH3 Drawing", 100, 10, 850, 400);
TPaveLabel *title = new TPaveLabel(0.04, 0.86, 0.96, 0.98,
"\"glbox\" and \"glbox1\" options for TH3.");
title->SetFillColor(32);
title->Draw();
TPad *boxPad = new TPad("box", "box", 0.02, 0.02, 0.48, 0.82);
TPad *box1Pad = new TPad("box1", "box1", 0.52, 0.02, 0.98, 0.82);
boxPad->Draw();
box1Pad->Draw();
TH3F *h31 = new TH3F("h31", "h31", 10, -1, 1, 10, -1, 1, 10, -1, 1);
TF3 * gxy = new TF3("gaus2","xygaus");
gxy->SetParameters(1,0,1,0,0.3);
h31->FillRandom("gaus2");
h31->SetFillColor(2);
boxPad->cd();
h31->Draw("glbox");
TH3F *h32 = new TH3F("h32", "h32", 10, -2, 2, 10, -1, 1, 10, -3, 3);
TF3 * g3 = new TF3("gaus3","xyzgaus");
g3->SetParameters(1,0,1,0,1,0,1);
h32->FillRandom("gaus3");
h32->SetFillColor(4);
box1Pad->cd();
h32->Draw("glbox1");
}
Author
Timur Pocheptsov

Definition in file glbox.C.

c
#define c(i)
Definition: RSha256.hxx:119
TStyle::SetCanvasPreferGL
void SetCanvasPreferGL(Bool_t prefer=kTRUE)
Definition: TStyle.h:325
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TPad
Definition: TPad.h:26
TPaveLabel::Draw
virtual void Draw(Option_t *option="")
Draw this pavelabel with its current attributes.
Definition: TPaveLabel.cxx:77
TH3::FillRandom
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
Definition: TH3.cxx:669
TF1::SetParameters
virtual void SetParameters(const Double_t *params)
Definition: TF1.h:640
gStyle
R__EXTERN TStyle * gStyle
Definition: TStyle.h:412
TF3
Definition: TF3.h:28
TH3F
3-D histogram with a float per channel (see TH1 documentation)}
Definition: TH3.h:267
TPaveLabel
Definition: TPaveLabel.h:20
TCanvas
Definition: TCanvas.h:23
TPad::cd
TVirtualPad * cd(Int_t subpadnumber=0)
Set Current pad.
Definition: TPad.cxx:594
TH1::Draw
virtual void Draw(Option_t *option="")
Draw this histogram with options.
Definition: TH1.cxx:2997
TPad::Draw
virtual void Draw(Option_t *option="")
Draw Pad in Current pad (re-parent pad if necessary).
Definition: TPad.cxx:1285