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);
Drawing line attributes for different objects.
static std::shared_ptr< RCanvas > Create(const std::string &title)
Create new canvas instance.
static R__DLLEXPORT constexpr RGB_t kBlue
virtual void UseStyle(const std::shared_ptr< RStyle > &style)
static std::shared_ptr< RStyle > Parse(const std::string &css_code)
Parse CSS code and returns std::shared_ptr<RStyle> when successful.
Provides v7 drawing facilities for TObject types (TGraph, TH1, TH2, etc).
@ kColors
list of ROOT colors
@ kPalette
list of colors from palette
@ kStyle
instance of TStyle object
RAttrLine line
! object line attributes
1-D histogram with an int per channel (see TH1 documentation)
Namespace for ROOT features in testing.
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.