32 Int_t indices[2] = {};
33 if (ROOT::GLTutorials::FindFreeCustomColorIndices(indices) != 2) {
34 Error(
"transp_text",
"failed to create new custom colors");
39 const Int_t grayColorIndex = indices[0], blackColorIndex = indices[1];
40 new TColor(grayColorIndex, 0.8, 0.8, 0.8,
"transparent_gray", 0.85);
41 new TColor(blackColorIndex, 0., 0., 0.,
"transparent_black", 0.5);
44 gStyle->SetCanvasPreferGL(kTRUE);
46 TCanvas *
const c1 =
new TCanvas(
"transparent text",
"transparent text demo", 10, 10, 900, 500);
48 ::Warning(
"transp_text",
"to use this macro you need OpenGL");
51 c1->SetBottomMargin(0.15);
54 const char *people[nx] = {
"Jean",
"Pierre",
"Marie",
"Odile",
55 "Sebastien",
"Fons",
"Rene",
"Nicolas",
"Xavier",
"Greg",
56 "Bjarne",
"Anton",
"Otto",
"Eddy",
"Peter",
"Pasha",
57 "Philippe",
"Suzanne",
"Jeff",
"Valery"};
59 TH1F *
const h =
new TH1F(
"h4",
"test", nx, 0, nx);
62 for (Int_t i = 0; i < 5000; ++i)
63 h->Fill(gRandom->Gaus(0.5 * nx, 0.2 * nx));
66 for (Int_t i = 1; i <= nx; ++i)
67 h->GetXaxis()->SetBinLabel(i, people[i - 1]);
71 TPaveText *
const pt =
new TPaveText(0.3, 0.3, 0.98, 0.98,
"brNDC");
73 pt->SetFillColor(grayColorIndex);
74 pt->SetTextColor(blackColorIndex);