28 ::Error(
"transparentpad",
"failed to create new custom colors");
33 TCanvas *
const c1 =
new TCanvas(
"transparent pad",
"transparent pad demo", 10, 10, 900, 500);
37 "You can see the transparency ONLY in a pdf or png output (\"File\"->\"Save As\" ->...)\n"
38 "To have transparency in a canvas graphics, you need OS X version with cocoa enabled");
42 new TColor(indices[0], 1., 0.2, 0.2,
"transparent_pink", 0.25);
43 new TColor(indices[1], 0.2, 1., 0.2,
"transparent_green", 0.25);
44 new TColor(indices[2], 0.2, 2., 1.,
"transparent_blue", 0.15);
47 TH1F *
const h1 =
new TH1F(
"TH1F 1",
"TH1F 1", 100, -1.5, 1.5);
50 TH1F *
const h2 =
new TH1F(
"TH1F 2",
"TH1F 2", 100, -1.5, 0.);
51 h2->FillRandom(
"gaus");
53 TH1F *
const h3 =
new TH1F(
"TH1F 3",
"TH1F 3", 100, 0.5, 2.);
54 h3->FillRandom(
"landau");
57 TPad *
const pad1 =
new TPad(
"transparent pad 1",
"transparent pad 1", 0.1, 0.1, 0.7, 0.7);
64 TPad *
const pad2 =
new TPad(
"transparent pad 2",
"transparent pad 2", 0.2, 0.2, 0.8, 0.8);
71 TPad *
const pad3 =
new TPad(
"transparent pad 3",
"transparent pad 3", 0.3, 0.3, 0.9, 0.9);
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
The color creation and management class.
1-D histogram with a float per channel (see TH1 documentation)
virtual void FillRandom(TF1 *f1, Int_t ntimes=5000, TRandom *rng=nullptr)
void Draw(Option_t *option="") override
Draw this histogram with options.
The most important graphics class in the ROOT system.
TVirtualPad * cd(Int_t subpadnumber=0) override
Set Current pad.
void Draw(Option_t *option="") override
Draw Pad in Current pad (re-parent pad if necessary).
unsigned FindFreeCustomColorIndices(Color_t(&indices)[N])