20 auto h =
dynamic_cast<TH1F *
>(obj);
24 auto Canvas2 = (
TCanvas *)
gROOT->GetListOfCanvases()->FindObject(
"Canvas2");
25 if (!
h->IsHighlight()) {
39 Canvas2 =
new TCanvas(
"Canvas2",
"Canvas2", 605, 0, 400, 400);
45 hz = (
TH1 *)
h->Clone(
"hz");
60void hist046_Graphics_highlight1D()
62 auto Canvas1 =
new TCanvas(
"Canvas1",
"", 0, 0, 600, 400);
63 Canvas1->HighlightConnect(
"HighlightZoom(TVirtualPad*,TObject*,Int_t,Int_t)");
65 auto f1 =
new TF1(
"f1",
"x*gaus(0) + [3]*abs(sin(x)/x)", -50.0, 50.0);
66 f1->SetParameters(20.0, 4.0, 1.0, 20.0);
67 auto h1 =
new TH1F(
"h1",
"Test random numbers", 200, -50.0, 50.0);
68 h1->FillRandom(
"f1", 100000);
74 info =
new TText(0.0,
h1->GetMaximum() * 0.7,
"please move the mouse over the frame");
int Int_t
Signed integer 4 bytes (int).
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
virtual void SetRange(Int_t first=0, Int_t last=0)
Set the viewing range for the axis using bin numbers.
1-D histogram with a float per channel (see TH1 documentation)
TH1 is the base class of all histogram classes in ROOT.
void SetTitle(const char *title) override
Change/set the title.
virtual Int_t GetNbinsX() const
void Draw(Option_t *option="") override
Draw this histogram with options.
virtual void SetHighlight(Bool_t set=kTRUE)
Set highlight (enable/disable) mode for the histogram by default highlight mode is disable.
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetTitle() const override
Returns title of object.
Mother of all ROOT objects.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
TVirtualPad is an abstract base class for the Pad and Canvas classes.