18void transparentpad(
bool gl =
true)
23 auto c1 =
new TCanvas(
"transparentpad",
"transparent pad demo", 10, 10, 900, 500);
24 if (!
c1->UseGL() && !
c1->IsWeb())
26 "You can see the transparency ONLY in a pdf or png output (\"File\"->\"Save As\" ->...)\n"
27 "To have transparency in a canvas graphics, you need either OpenGL or Web rendering enabled");
30 auto h1 =
new TH1F(
"TH1F 1",
"TH1F 1", 100, -1.5, 1.5);
33 auto h2 =
new TH1F(
"TH1F 2",
"TH1F 2", 100, -1.5, 0.);
34 h2->FillRandom(
"gaus");
36 auto h3 =
new TH1F(
"TH1F 3",
"TH1F 3", 100, 0.5, 2.);
37 h3->FillRandom(
"landau");
40 auto pad1 =
new TPad(
"transparent pad 1",
"transparent pad 1", 0.1, 0.1, 0.7, 0.7);
47 auto pad2 =
new TPad(
"transparent pad 2",
"transparent pad 2", 0.2, 0.2, 0.8, 0.8);
54 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(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.
void SetCanvasPreferGL(Bool_t prefer=kTRUE)