18void transparentpad(
bool gl =
true)
23 auto c1 =
new TCanvas(
"transparentpad",
"transparent pad demo", 10, 10, 900, 500);
24 if (!
c1->UseGL() && !
c1->IsWeb())
25 ::Warning(
"transparentpad",
"You can see the transparency ONLY in a pdf or png output (\"File\"->\"Save As\" ->...)\n"
26 "To have transparency in a canvas graphics, you need either OpenGL or Web rendering enabled");
29 auto h1 =
new TH1F(
"TH1F 1",
"TH1F 1", 100, -1.5, 1.5);
32 auto h2 =
new TH1F(
"TH1F 2",
"TH1F 2", 100, -1.5, 0.);
33 h2->FillRandom(
"gaus");
35 auto h3 =
new TH1F(
"TH1F 3",
"TH1F 3", 100, 0.5, 2.);
36 h3->FillRandom(
"landau");
39 auto pad1 =
new TPad(
"transparent pad 1",
"transparent pad 1", 0.1, 0.1, 0.7, 0.7);
46 auto pad2 =
new TPad(
"transparent pad 2",
"transparent pad 2", 0.2, 0.2, 0.8, 0.8);
53 auto pad3 =
new TPad(
"transparent pad 3",
"transparent pad 3", 0.3, 0.3, 0.9, 0.9);
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
R__EXTERN TStyle * gStyle
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
1-D histogram with a float per channel (see TH1 documentation)
virtual void FillRandom(const char *fname, Int_t ntimes=5000, TRandom *rng=nullptr)
Fill histogram following distribution in function fname.
void Draw(Option_t *option="") override
Draw this histogram with options.
The most important graphics class in the ROOT system.
void SetCanvasPreferGL(Bool_t prefer=kTRUE)