# Highlighted 2D Histogram. Display TH1D row-associated simultaneously in other window

**URL:** <https://root-forum.cern.ch/t/highlighted-2d-histogram-display-th1d-row-associated-simultaneously-in-other-window/39590>\
**Category:** Newbie\
**Tags:** python, root\
**Created:** [May 25, 2020, 2:53pm UTC](https://root-forum.cern.ch/t/highlighted-2d-histogram-display-th1d-row-associated-simultaneously-in-other-window/39590 "2020-05-25T14:53:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LCC](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ccd318/32.png) [@LCC](https://root-forum.cern.ch/u/LCC)\
**Post date:** [May 25, 2020, 2:53pm UTC](https://root-forum.cern.ch/t/highlighted-2d-histogram-display-th1d-row-associated-simultaneously-in-other-window/39590/1 "2020-05-25T14:53:01Z")

</div>

Hi,  
I created a program in Python that makes a ROOT.TH2D histogram and save it into a Canvas.  
My next step is to configure an algorithm that, for each row where my mouse cursor is being displayed, highlight that row and display **simultaneously** other canvas with the TH1D histogram associated, as shown in the _Highlight mode for histogram_ example here:

[https://root.cern/doc/master/classTHistPainter.html#HP30](https://root.cern/doc/master/classTHistPainter.html#HP30)

More graphically, my intentions can be better understood with this image:

 ![pregunta_foro_root](https://root-forum.cern.ch/uploads/default/original/3X/a/9/a9acb5e47cf1d4a0ccedda61cd9845750235645d.png)

and, if I move my cursor to other row, the canvas with the TH1D change too.  
How can I do this?

Sorry if this is a duplicate question, but the most similar posts I found were about GUI issues with no special focus in this behaviour…

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [May 25, 2020, 3:29pm UTC](https://root-forum.cern.ch/t/highlighted-2d-histogram-display-th1d-row-associated-simultaneously-in-other-window/39590/2 "2020-05-25T15:29:40Z")

</div>

Basically all the information you can get about this mechanism is in the examples here:  
[https://root.cern/doc/master/group\_\_tutorial\_\_hist.html](https://root.cern/doc/master/group __tutorial__ hist.html)

[hlHisto1.C](https://root.cern/doc/master/hlHisto1_8C.html)  
[hlHisto2.C](https://root.cern/doc/master/hlHisto2_8C.html)  
[hlHisto3.C](https://root.cern/doc/master/hlHisto3_8C.html)  
[hlHisto4.C](https://root.cern/doc/master/hlHisto4_8C.html)

---

<div class="post-metadata">

**Author:** ![LCC](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ccd318/32.png) [@LCC](https://root-forum.cern.ch/u/LCC)\
**Post date:** [May 25, 2020, 4:10pm UTC](https://root-forum.cern.ch/t/highlighted-2d-histogram-display-th1d-row-associated-simultaneously-in-other-window/39590/3 "2020-05-25T16:10:34Z")

</div>

That is exactly all the information I wanted.  
Thank you @couet!
