Updated by Timur Pocheptsov to use transparent text. The macro requires OpenGL or Web-based canvas
void transp_text(bool gl = true)
{
auto c1 =
new TCanvas(
"transp_text",
"transparent text demo", 10, 10, 900, 500);
if (!
c1->UseGL() && !
c1->IsWeb())
::Warning(
"transp_text",
"to use this macro you need either OpenGL or Web");
c1->SetBottomMargin(0.15);
const char *people[nx] = {"Jean","Pierre","Marie","Odile",
"Sebastien","Fons","Rene","Nicolas","Xavier","Greg",
"Bjarne","Anton","Otto","Eddy","Peter","Pasha",
"Philippe","Suzanne","Jeff","Valery"};
auto h =
new TH1F(
"h4",
"test", nx, 0, nx);
for (
Int_t i = 0; i < 5000; ++i)
for (
Int_t i = 1; i <= nx; ++i)
h->GetXaxis()->SetBinLabel(i, people[i - 1]);
auto pt =
new TPaveText(0.3, 0.3, 0.98, 0.98,
"brNDC");
}
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
R__EXTERN TRandom * gRandom
R__EXTERN TStyle * gStyle
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.
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)
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.
void Draw(Option_t *option="") override
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...
void SetCanvasPreferGL(Bool_t prefer=kTRUE)