31 ::Error(
"transp_text",
"failed to create new custom colors");
36 const Color_t grayColorIndex = indices[0], blackColorIndex = indices[1];
37 new TColor(grayColorIndex, 0.8, 0.8, 0.8,
"transparent_gray", 0.85);
38 new TColor(blackColorIndex, 0., 0., 0.,
"transparent_black", 0.5);
41 TCanvas *
const c1 =
new TCanvas(
"transparent text",
"transparent text demo", 10, 10, 900, 500);
44 ::Warning(
"transt_text",
"You can see the transparency ONLY in a pdf or png output (\"File\"->\"Save As\" ->...)\n"
45 "To have transparency in a canvas graphics, you need OS X version with cocoa enabled");
49 c1->SetBottomMargin(0.15);
52 const char *people[nx] = {
"Jean",
"Pierre",
"Marie",
"Odile",
53 "Sebastien",
"Fons",
"Rene",
"Nicolas",
"Xavier",
"Greg",
54 "Bjarne",
"Anton",
"Otto",
"Eddy",
"Peter",
"Pasha",
55 "Philippe",
"Suzanne",
"Jeff",
"Valery"};
57 TH1F *
const h =
new TH1F(
"h4",
"test", nx, 0, nx);
60 for (
Int_t i = 0; i < 5000; ++i)
64 for (
Int_t i = 1; i <= nx; ++i)
65 h->GetXaxis()->SetBinLabel(i, people[i - 1]);
void Error(const char *location, const char *msgfmt,...)
void Warning(const char *location, const char *msgfmt,...)
R__EXTERN TRandom * gRandom
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
The color creation and management class.
1-D histogram with a float per channel (see TH1 documentation)}
A Pave (see TPave) with text, lines or/and boxes inside.
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
unsigned FindFreeCustomColorIndices(Color_t(&indices)[N])