25#include "ROOT/RLegend.hxx"
34 auto pHist = std::make_shared<RH1D>(xaxis);
35 auto pHist2 = std::make_shared<RH1D>(xaxis);
37 for (
int n=0;
n<1000;
n++) {
38 pHist->Fill(
gRandom->Gaus(3,0.8));
39 pHist2->Fill(
gRandom->Gaus(7,1.2));
49 auto draw1 = canvas->Draw(pHist);
50 draw1->line.width = 2.f;
51 draw1->line.color = .3f;
54 auto draw2 = canvas->Draw(pHist2);
55 draw2->line.width = 4.f;
56 draw2->line.color = .7f;
58 auto legend = canvas->Draw<RLegend>(
"Legend title");
59 legend->fill.color =
RColor(0, 0, 120, 25);
62 legend->border.width = 2;
63 legend->AddEntry(draw1,
"histo1",
"l");
64 legend->AddEntry(draw2,
"histo2",
"l");
67 auto custom = legend->AddEntry(
"test",
"lfm");
69 custom->line.width = 5.;
74 custom->marker.size = 0.03;
77 canvas->SetSize(1000, 700);
R__EXTERN TRandom * gRandom
Objects used to configure the different axis types.
static std::shared_ptr< RCanvas > Create(const std::string &title)
Create new canvas instance.
static R__DLLEXPORT constexpr RGB_t kRed
static R__DLLEXPORT constexpr RGB_t kGreen
static R__DLLEXPORT constexpr RGB_t kWhite
static R__DLLEXPORT constexpr RGB_t kBlack
static R__DLLEXPORT constexpr RGB_t kBlue
A color palette draw near the frame.