34auto tobject_style = RStyle::Parse(
"tgraph { line_width: 3; line_color: red; }");
38 static constexpr int npoints = 10;
39 static constexpr int nth1points = 100;
40 static constexpr int nth2points = 40;
42 double x[npoints] = { 1., 2., 3., 4., 5., 6., 7., 8., 9., 10. };
43 double y[npoints] = { .1, .2, .3, .4, .3, .2, .1, .2, .3, .4 };
47 auto th1 =
new TH1I(
"gaus",
"Example of TH1", nth1points, -5, 5);
50 th1->FillRandom(
"gaus", 5000);
53 auto th2 = std::make_shared<TH2I>(
"gaus2",
"Example of TH2", nth2points, -5, 5, nth2points, -5, 5);
55 th2->SetDirectory(
nullptr);
56 for (
int n=0;
n<nth2points;++
n) {
57 for (
int k=0;k<nth2points;++k) {
58 double x = 10.*
n/nth2points-5.;
59 double y = 10.*k/nth2points-5.;
66 auto canvas = RCanvas::Create(
"RCanvas showing TObject-derived classes");
80 auto subpads = canvas->Divide(2,2);
87 drawth1->
line =
RAttrLine(RColor::kBlue, 3., RAttrLine::kDashed);
R__EXTERN TStyle * gStyle
Drawing line attributes for different objects.
virtual void UseStyle(const std::shared_ptr< RStyle > &style)
Provides v7 drawing facilities for TObject types (TGraph, TH1, TH2, etc).
RAttrLine line
! object line attributes
A TGraph is an object made of two arrays X and Y with npoints each.
1-D histogram with an int per channel (see TH1 documentation)
void SetPalette(Int_t ncolors=kBird, Int_t *colors=nullptr, Float_t alpha=1.)
See TColor::SetPalette.
Double_t Gaus(Double_t x, Double_t mean=0, Double_t sigma=1, Bool_t norm=kFALSE)
Calculates a gaussian function with mean and sigma.