23#include "ROOT/RLegend.hxx"
36 auto pHist = std::make_shared<RH1D>(xaxis);
37 auto pHist2 = std::make_shared<RH1D>(xaxis);
39 for (
int n=0;
n<1000;
n++) {
45 auto canvas = RCanvas::Create(
"Canvas Title");
48 auto draw1 = canvas->Draw(pHist);
49 draw1->AttrLine().SetWidth(2).AttrColor().SetAuto();
52 auto draw2 = canvas->Draw(pHist2);
53 draw2->AttrLine().SetWidth(4).AttrColor().SetAuto();
55 canvas->AssignAutoColors();
57 auto legend = canvas->Draw<RLegend>(
RPadPos(0.5_normal, 0.6_normal),
RPadPos(0.9_normal,0.9_normal),
"Legend title");
59 legend->AttrBox().AttrBorder().SetWidth(2).SetColor(
RColor::kRed);
60 legend->AddEntry(draw1,
"histo1").SetLine(
"line_");
61 legend->AddEntry(draw2,
"histo2").SetLine(
"line_");
#define R__LOAD_LIBRARY(LIBRARY)
R__EXTERN TRandom * gRandom
Objects used to configure the different axis types.
A position (horizontal and vertical) in a RPad.
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...