ROOT logo
{
//=========Macro generated from canvas: c1/c1
//=========  (Mon Jun 22 14:36:43 2009) by ROOT version5.23/05
   TCanvas *c1 = new TCanvas("c1", "c1",4,21,700,500);
   c1->Range(-0.5,-0.6902642,4.5,3.202077);
   c1->SetBorderSize(2);
   c1->SetLogy();
   c1->SetGridx();
   c1->SetGridy();
   c1->SetFrameFillColor(0);
   
   TH1 *h1 = new TH1F("h1","Random 1D Gaussian",100,-4,4);
   h1->SetBinContent(1,2);
   h1->SetBinContent(7,1);
   h1->SetBinContent(9,1);
   h1->SetBinContent(10,1);
   h1->SetBinContent(11,2);
   h1->SetBinContent(12,4);
   h1->SetBinContent(13,2);
   h1->SetBinContent(14,7);
   h1->SetBinContent(15,4);
   h1->SetBinContent(16,13);
   h1->SetBinContent(17,10);
   h1->SetBinContent(18,11);
   h1->SetBinContent(19,7);
   h1->SetBinContent(20,15);
   h1->SetBinContent(21,20);
   h1->SetBinContent(22,25);
   h1->SetBinContent(23,27);
   h1->SetBinContent(24,35);
   h1->SetBinContent(25,43);
   h1->SetBinContent(26,60);
   h1->SetBinContent(27,51);
   h1->SetBinContent(28,49);
   h1->SetBinContent(29,75);
   h1->SetBinContent(30,71);
   h1->SetBinContent(31,100);
   h1->SetBinContent(32,104);
   h1->SetBinContent(33,111);
   h1->SetBinContent(34,123);
   h1->SetBinContent(35,145);
   h1->SetBinContent(36,177);
   h1->SetBinContent(37,181);
   h1->SetBinContent(38,184);
   h1->SetBinContent(39,214);
   h1->SetBinContent(40,224);
   h1->SetBinContent(41,224);
   h1->SetBinContent(42,236);
   h1->SetBinContent(43,263);
   h1->SetBinContent(44,281);
   h1->SetBinContent(45,291);
   h1->SetBinContent(46,323);
   h1->SetBinContent(47,305);
   h1->SetBinContent(48,313);
   h1->SetBinContent(49,323);
   h1->SetBinContent(50,326);
   h1->SetBinContent(51,307);
   h1->SetBinContent(52,319);
   h1->SetBinContent(53,343);
   h1->SetBinContent(54,294);
   h1->SetBinContent(55,318);
   h1->SetBinContent(56,325);
   h1->SetBinContent(57,255);
   h1->SetBinContent(58,240);
   h1->SetBinContent(59,254);
   h1->SetBinContent(60,235);
   h1->SetBinContent(61,212);
   h1->SetBinContent(62,204);
   h1->SetBinContent(63,182);
   h1->SetBinContent(64,184);
   h1->SetBinContent(65,168);
   h1->SetBinContent(66,141);
   h1->SetBinContent(67,125);
   h1->SetBinContent(68,122);
   h1->SetBinContent(69,106);
   h1->SetBinContent(70,106);
   h1->SetBinContent(71,78);
   h1->SetBinContent(72,79);
   h1->SetBinContent(73,78);
   h1->SetBinContent(74,49);
   h1->SetBinContent(75,49);
   h1->SetBinContent(76,42);
   h1->SetBinContent(77,37);
   h1->SetBinContent(78,27);
   h1->SetBinContent(79,26);
   h1->SetBinContent(80,20);
   h1->SetBinContent(81,19);
   h1->SetBinContent(82,12);
   h1->SetBinContent(83,14);
   h1->SetBinContent(84,12);
   h1->SetBinContent(85,7);
   h1->SetBinContent(86,5);
   h1->SetBinContent(87,6);
   h1->SetBinContent(88,4);
   h1->SetBinContent(89,2);
   h1->SetBinContent(91,2);
   h1->SetBinContent(92,1);
   h1->SetBinContent(93,2);
   h1->SetBinContent(94,2);
   h1->SetBinContent(97,1);
   h1->SetBinContent(99,2);
   h1->SetEntries(10000);
   h1->SetDirectory(0);
   
   TPaveStats *ptstats = new TPaveStats(0.625,0.6885593,0.8261494,0.8474576,"brNDC");
   ptstats->SetName("stats");
   ptstats->SetBorderSize(2);
   ptstats->SetFillColor(30);
   ptstats->SetTextAlign(12);
   TText *text = ptstats->AddText("h1");
   text->SetTextSize(0.03654661);
   text = ptstats->AddText("Entries = 10000  ");
   text = ptstats->AddText("Mean  =  0.804");
   text = ptstats->AddText("RMS   = 0.6138");
   ptstats->SetOptStat(1111);
   ptstats->SetOptFit(0);
   ptstats->Draw();
   h1->GetListOfFunctions()->Add(ptstats);
   ptstats->SetParent(h1->GetListOfFunctions());
   h1->SetFillColor(2);
   h1->SetFillStyle(3002);
   h1->GetXaxis()->SetTitle("X axis");
   h1->GetXaxis()->SetRange(51,100);
   h1->GetYaxis()->SetTitle("Y axis");
   h1->Draw("");
   
   TPaveText *pt = new TPaveText(0.3275862,0.9194915,0.6724138,0.9682203,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(2);

   Int_t ci;   // for color index setting
   ci = TColor::GetColor("#cccc33");
   pt->SetFillColor(ci);
   text = pt->AddText("Random 1D Gaussian");
   pt->Draw();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}
 c1.C:1
 c1.C:2
 c1.C:3
 c1.C:4
 c1.C:5
 c1.C:6
 c1.C:7
 c1.C:8
 c1.C:9
 c1.C:10
 c1.C:11
 c1.C:12
 c1.C:13
 c1.C:14
 c1.C:15
 c1.C:16
 c1.C:17
 c1.C:18
 c1.C:19
 c1.C:20
 c1.C:21
 c1.C:22
 c1.C:23
 c1.C:24
 c1.C:25
 c1.C:26
 c1.C:27
 c1.C:28
 c1.C:29
 c1.C:30
 c1.C:31
 c1.C:32
 c1.C:33
 c1.C:34
 c1.C:35
 c1.C:36
 c1.C:37
 c1.C:38
 c1.C:39
 c1.C:40
 c1.C:41
 c1.C:42
 c1.C:43
 c1.C:44
 c1.C:45
 c1.C:46
 c1.C:47
 c1.C:48
 c1.C:49
 c1.C:50
 c1.C:51
 c1.C:52
 c1.C:53
 c1.C:54
 c1.C:55
 c1.C:56
 c1.C:57
 c1.C:58
 c1.C:59
 c1.C:60
 c1.C:61
 c1.C:62
 c1.C:63
 c1.C:64
 c1.C:65
 c1.C:66
 c1.C:67
 c1.C:68
 c1.C:69
 c1.C:70
 c1.C:71
 c1.C:72
 c1.C:73
 c1.C:74
 c1.C:75
 c1.C:76
 c1.C:77
 c1.C:78
 c1.C:79
 c1.C:80
 c1.C:81
 c1.C:82
 c1.C:83
 c1.C:84
 c1.C:85
 c1.C:86
 c1.C:87
 c1.C:88
 c1.C:89
 c1.C:90
 c1.C:91
 c1.C:92
 c1.C:93
 c1.C:94
 c1.C:95
 c1.C:96
 c1.C:97
 c1.C:98
 c1.C:99
 c1.C:100
 c1.C:101
 c1.C:102
 c1.C:103
 c1.C:104
 c1.C:105
 c1.C:106
 c1.C:107
 c1.C:108
 c1.C:109
 c1.C:110
 c1.C:111
 c1.C:112
 c1.C:113
 c1.C:114
 c1.C:115
 c1.C:116
 c1.C:117
 c1.C:118
 c1.C:119
 c1.C:120
 c1.C:121
 c1.C:122
 c1.C:123
 c1.C:124
 c1.C:125
 c1.C:126
 c1.C:127
 c1.C:128
 c1.C:129
 c1.C:130
 c1.C:131
 c1.C:132
 c1.C:133
 c1.C:134
 c1.C:135
 c1.C:136
 c1.C:137
 c1.C:138
 c1.C:139
 c1.C:140