13TGraph *grxy, *grin, *grout;
15void DrawSmooth(
Int_t pad,
const char *title,
const char *xt,
const char *yt)
18 TH1F *vFrame =
gPad->DrawFrame(0,0,15,150);
34void gr010_approx_smooth()
38 Double_t x[] = {1,2,3,4,5,6,6,6,8,9,10};
39 Double_t y[] = {1,4,9,16,25,25,36,49,64,81,100};
45 {1.2,1.7,2.5,3.2,4.4,5.2,5.7,6.5,7.6,8.3,9.7,10.4,11.3,13};
48 vC1 =
new TCanvas(
"vC1",
"square",200,10,700,700);
55 grout = gs->Approx(grin,
"linear");
56 DrawSmooth(1,
"Approx: ties = mean",
"X-axis",
"Y-axis");
62 grout = gs->Approx(grin,
"linear", 14, xout, 0, 130);
63 DrawSmooth(2,
"Approx: ties = mean",
"",
"");
68 for (
Int_t k=0;k<vNout;k++) {
70 cout <<
"k= " << k <<
" vXout[k]= " << vXout
71 <<
" vYout[k]= " << vYout << endl;
78 grout = gs->Approx(grin,
"constant", 50, 0, 0, 0, 1, 0.5,
"min");
79 DrawSmooth(3,
"Approx: ties = min",
"",
"");
84 grout = gs->Approx(grin,
"linear", 14, xout, 0, 0, 2, 0,
"max");
85 DrawSmooth(4,
"Approx: ties = max",
"",
"");
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
A helper class to smooth TGraph.
void Draw(Option_t *chopt="") override
Default Draw method for all objects.
virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y) const
1-D histogram with a float per channel (see TH1 documentation)
virtual void SetTitleSize(Float_t size=0.02, Option_t *axis="X")
Set the axis' title size.
void SetTitle(const char *title) override
Change/set the title.
virtual void SetXTitle(const char *title)
virtual void SetYTitle(const char *title)
virtual TObject * DrawClone(Option_t *option="") const
Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
Automatic pad generation by division.