36 static constexpr int npoints = 10;
37 double x[npoints] = { 0., 1., 2., 3., 4., 5., 6., 7., 8., 9. };
38 double y[npoints] = { .1, .2, .3, .4, .3, .2, .1, .2, .3, .4 };
39 auto gr = std::make_shared<TGraph>(npoints,
x,
y);
41 static constexpr int nth1points = 100;
42 auto th1 = std::make_shared<TH1I>(
"gaus",
"Example of TH1", nth1points, -5, 5);
43 th1->SetDirectory(
nullptr);
44 for (
int n=0;
n<nth1points;++
n) {
45 double x = 10.*
n/nth1points-5.;
49 static constexpr int nth2points = 40;
50 auto th2 = std::make_shared<TH2I>(
"gaus2",
"Example of TH1", nth2points, -5, 5, nth2points, -5, 5);
51 th2->SetDirectory(
nullptr);
52 for (
int n=0;
n<nth2points;++
n) {
53 for (
int k=0;k<nth2points;++k) {
54 double x = 10.*
n/nth2points-5.;
55 double y = 10.*k/nth2points-5.;
62 auto canvas = RCanvas::Create(
"RCanvas showing a v6 objects");
77 auto subpads = canvas->Divide(2,2);
91 canvas->Update(
false, [](
bool res) { std::cout <<
"First sync update done = " << (res ?
"true" :
"false") << std::endl; });
97 canvas->Update(
true, [](
bool res) { std::cout <<
"Second async update done = " << (res ?
"true" :
"false") << std::endl; });
99 std::cout <<
"This message appear normally before second async update" << std::endl;
R__EXTERN TStyle * gStyle
Provides v7 drawing facilities for TObject types (TGraph etc).
void SetPalette(Int_t ncolors=kBird, Int_t *colors=0, 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)
Calculate a gaussian function with mean and sigma.