20 auto h2 =
dynamic_cast<TH2F *
>(obj);
23 auto CanvasProj = (
TCanvas *)
gROOT->GetListOfCanvases()->FindObject(
"CanvasProj");
24 if (!h2->IsHighlight()) {
27 h2->SetTitle(
"Disable highlight");
34 auto px = h2->ProjectionX(
"_px", yhb, yhb);
35 auto py = h2->ProjectionY(
"_py", xhb, xhb);
40 CanvasProj =
new TCanvas(
"CanvasProj",
"CanvasProj", 505, 0, 600, 600);
41 CanvasProj->Divide(1, 2);
48 h2->SetTitle(
TString::Format(
"Highlight bin [%02d, %02d]", xhb, yhb).Data());
52 CanvasProj->GetPad(1)->Modified();
53 CanvasProj->GetPad(2)->Modified();
57void hist044_Graphics_highlight2D()
59 auto c1 =
new TCanvas(
"Canvas",
"Canvas", 0, 0, 500, 500);
60 c1->HighlightConnect(
"Highlight2(TVirtualPad*,TObject*,Int_t,Int_t)");
62 auto h2 =
new TH2F(
"h2",
"", 50, -5.0, 5.0, 50, -5.0, 5.0);
63 for (
Int_t i = 0; i < 10000; i++)
67 info =
new TText(0.0, -4.0,
"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.
2-D histogram with a float per channel (see TH1 documentation)
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
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.
virtual void Modified(Bool_t flag=1)=0