Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches

Detailed Description

This demo shows how to use transparency.

// Includes for ACLiC (cling does not need them).
#include "TCanvas.h"
#include "TColor.h"
#include "TError.h"
#include "TStyle.h"
#include "TH1F.h"
void transp(bool gl = true)
{
auto redIndex = TColor::GetColor((Float_t)1., 0., 0., 0.85);
auto greeIndex = TColor::GetColor((Float_t)0., 1., 0., 0.5);
auto cnv = new TCanvas("trasnparency", "transparency demo", 600, 400);
auto hist = new TH1F("a5", "b5", 10, -2., 3.);
auto hist2 = new TH1F("c6", "d6", 10, -3., 3.);
hist->FillRandom("landau", 100000);
hist2->FillRandom("gaus", 100000);
hist->SetFillColor(redIndex);
hist2->SetFillColor(greeIndex);
cnv->cd();
hist2->Draw();
hist->Draw("SAME");
}
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TStyle * gStyle
Definition TStyle.h:442
The Canvas class.
Definition TCanvas.h:23
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Definition TColor.cxx:1924
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:645
void SetCanvasPreferGL(Bool_t prefer=kTRUE)
Definition TStyle.h:345
Authors
Timur Pocheptsov, Sergey Linev

Definition in file transp.C.