Create an image from a 2-D histogram and manipulate it.
{
canv->ToggleEventStatus();
canv->SetRightMargin(0.2);
canv->SetLeftMargin(0.01);
canv->SetTopMargin(0.01);
canv->SetBottomMargin(0.01);
TF2 *f2 =
new TF2(
"f2",
"(xygaus + xygaus(5) + xylandau(10))",-4,4,-4,4);
Double_t params[] = {130,-1.4,1.8,1.5,1, 150,2,0.5,-2,0.5, 3600,-2,0.7,-3,0.3};
TH2D *h2 =
new TH2D(
"h2",
"xygaus + xygaus(5) + xylandau(10)",100,-4,4,100,-4,4);
h2->FillRandom("f2",40000);
img->SetImage((
const Double_t *)h2->GetArray(), h2->GetNbinsX() + 2,
img->StartPaletteEditor();
}
R__EXTERN TImagePalette * gHistImagePalette
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
virtual void SetParameters(const Double_t *params)
A 2-Dim function with parameters.
2-D histogram with a double per channel (see TH1 documentation)
An abstract interface to image processing library.
static TImage * Create()
Create an image.
- Author
- Valeriy Onuchin
Definition in file hist2image.C.