This demo shows how to use transparency.
On MacOS X you can see the transparency in a canvas, you can save canvas contents as pdf/png (and thus you'll have an image with transparency on every platform).
void transp()
{
::Error(
"transp",
"failed to create new custom colors");
return;
}
const Color_t redIndex = indices[0], greeIndex = indices[1];
new TColor(redIndex, 1., 0., 0.,
"red", 0.85);
new TColor(greeIndex, 0., 1., 0.,
"green", 0.5);
TCanvas *
const cnv =
new TCanvas(
"transparency",
"transparency demo", 600, 400);
Warning(
"transp",
"You can see the transparency ONLY in a pdf or png output (\"File\"->\"Save As\" ->...)\n"
"To have transparency in a canvas graphics, you need MacOSX version with cocoa enabled");
}
TH1F *
const hist =
new TH1F(
"a5",
"b5", 10, -2., 3.);
TH1F *
const hist2 =
new TH1F(
"c6",
"d6", 10, -3., 3.);
}
void Error(const char *location, const char *msgfmt,...)
void Warning(const char *location, const char *msgfmt,...)
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
The color creation and management class.
1-D histogram with a float per channel (see TH1 documentation)}
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
unsigned FindFreeCustomColorIndices(Color_t(&indices)[N])
- Author
- Timur Pocheptsov
Definition in file transp.C.