23#include "ROOT/RLegend.hxx"
37 auto pHist = std::make_shared<RH1D>(xaxis);
38 auto pHist2 = std::make_shared<RH1D>(xaxis);
40 for (
int n=0;
n<1000;
n++) {
46 auto canvas = RCanvas::Create(
"Canvas Title");
49 auto draw1 = canvas->Draw(pHist);
50 draw1->AttrLine().SetWidth(2).AttrColor().SetAuto();
53 auto draw2 = canvas->Draw(pHist2);
54 draw2->AttrLine().SetWidth(4).AttrColor().SetAuto();
56 canvas->AssignAutoColors();
58 auto legend = canvas->Draw<RLegend>(
"Legend title");
61 legend->AddEntry(draw1,
"histo1");
62 legend->AddEntry(draw2,
"histo2");
68 canvas->SetSize(1000, 700);
#define R__LOAD_LIBRARY(LIBRARY)
R__EXTERN TRandom * gRandom
Drawing fill attributes for different objects.
RAttrFill & SetStyle(int style)
The fill style.
RAttrFill & SetColor(const RColor &color)
The fill color.
Drawing line attributes for different objects.
RAttrLine & SetColor(const RColor &color)
The color of the line.
RAttrLine & SetWidth(double width)
The width of the line.
RAttrMarker & SetColor(const RColor &color)
RAttrMarker & SetStyle(int style)
The style of the marker.
RAttrMarker & SetSize(double size)
The size of the marker.
Objects used to configure the different axis types.
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...