21void grad2(
bool gl =
true)
27 auto cnv =
new TCanvas(
"grad2",
"gradient demo 2", 100, 100, 800, 600);
28 if (!cnv->UseGL() && !cnv->IsWeb())
29 ::Warning(
"grad2",
"This macro requires either OpenGL or Web canvas to correctly handle gradient colors");
49 auto hist =
new TH1F(
"a2",
"b2", 10, -2., 3.);
50 auto hist2 =
new TH1F(
"c3",
"d3", 10, -3., 3.);
51 hist->FillRandom(
"landau", 100000);
52 hist2->FillRandom(
"gaus", 100000);
54 hist->SetFillColor(grad1);
55 hist2->SetFillColor(grad2);
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
R__EXTERN TStyle * gStyle
static Int_t GetLinearGradient(Double_t angle, const std::vector< Int_t > &colors, const std::vector< Double_t > &positions={})
Static function: Returns the linear gradient color number corresponding to specified parameters.
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)
void SetCanvasPreferGL(Bool_t prefer=kTRUE)