ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
glbox.C
Go to the documentation of this file.
1 void glbox()
2 {
3 // Display a 3D histogram using GL (box option).
4 //Author: Timur Pocheptsov
6  TCanvas *c = new TCanvas("glc","TH3 Drawing", 100, 10, 850, 400);
7  TPaveLabel *title = new TPaveLabel(0.04, 0.86, 0.96, 0.98,
8  "\"glbox\" and \"glbox1\" options for TH3.");
9  title->SetFillColor(32);
10  title->Draw();
11 
12  TPad *boxPad = new TPad("box", "box", 0.02, 0.02, 0.48, 0.82);
13  TPad *box1Pad = new TPad("box1", "box1", 0.52, 0.02, 0.98, 0.82);
14  boxPad->Draw();
15  box1Pad->Draw();
16 
17  TH3F *h31 = new TH3F("h31", "h31", 10, -1, 1, 10, -1, 1, 10, -1, 1);
18  h31->FillRandom("gaus");
19  h31->SetFillColor(2);
20  boxPad->cd();
21  h31->Draw("glbox");
22 
23  TH3F *h32 = new TH3F("h32", "h32", 10, -2, 2, 10, -1, 1, 10, -3, 3);
24  h32->FillRandom("gaus");
25  h32->SetFillColor(4);
26  box1Pad->cd();
27  h32->Draw("glbox1");
28 }
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
return c
R__EXTERN TStyle * gStyle
Definition: TStyle.h:423
void glbox()
Definition: glbox.C:1
TVirtualPad * cd(Int_t subpadnumber=0)
Set Current pad.
Definition: TPad.cxx:514
virtual void Draw(Option_t *option="")
Draw Pad in Current pad (re-parent pad if necessary).
Definition: TPad.cxx:1192
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
The most important graphics class in the ROOT system.
Definition: TPad.h:46
The Canvas class.
Definition: TCanvas.h:48
virtual void Draw(Option_t *option="")
Draw this pavelabel with its current attributes.
Definition: TPaveLabel.cxx:77
const Bool_t kTRUE
Definition: Rtypes.h:91