15 const char *people[nx] = {
"Jean",
"Pierre",
"Marie",
"Odile",
16 "Sebastien",
"Fons",
"Rene",
"Nicolas",
"Xavier",
"Greg",
17 "Bjarne",
"Anton",
"Otto",
"Eddy",
"Peter",
"Pasha",
18 "Philippe",
"Suzanne",
"Jeff",
"Valery"};
19 TCanvas *c1 =
new TCanvas(
"c1",
"demo bin labels",10,10,900,500);
21 c1->SetBottomMargin(0.15);
22 TH1F *h =
new TH1F(
"h",
"test",nx,0,nx);
24 for (i=0;i<5000;i++) h->Fill(gRandom->Gaus(0.5*nx,0.2*nx));
26 for (i=1;i<=nx;i++) h->GetXaxis()->SetBinLabel(i,people[i-1]);
28 TPaveText *pt =
new TPaveText(0.6,0.7,0.98,0.98,
"brNDC");
31 pt->AddText(
"Use the axis Context Menu LabelsOption");
32 pt->AddText(
" \"a\" to sort by alphabetic order");
33 pt->AddText(
" \">\" to sort by decreasing values");
34 pt->AddText(
" \"<\" to sort by increasing values");