# Drawing polymarkers from different TSpectrum::Search() on same canvas?

**URL:** <https://root-forum.cern.ch/t/drawing-polymarkers-from-different-tspectrum-search-on-same-canvas/58375>\
**Category:** Newbie\
**Created:** [March 4, 2024, 8:52am UTC](https://root-forum.cern.ch/t/drawing-polymarkers-from-different-tspectrum-search-on-same-canvas/58375 "2024-03-04T08:52:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [March 4, 2024, 8:52am UTC](https://root-forum.cern.ch/t/drawing-polymarkers-from-different-tspectrum-search-on-same-canvas/58375/1 "2024-03-04T08:52:54Z")

</div>

I am searching peaks in two different regions of a same 1d histogram (his)

```auto
 his->GetXaxis()->SetRangeUser(20,600);
sigma = 18; threshold = 0.4;
TSpectrum *s_low = new TSpectrum(5);
Int_t nfound = s_low->Search(his, sigma, "", threshold);
Double_t *xpeaks = s_low->GetPositionX();

 his->GetXaxis()->SetRangeUser(600,1000);
sigma = 12; threshold = 0.04;
TSpectrum *s_mid = new TSpectrum(5);
nfound = s_mid->Search(his, sigma, "", threshold);
xpeaks = s_mid->GetPositionX();

```

As expected, I am seeing the red polymarkers only for the second search region. Is it possible to retrieve and draw the polymakers of the first search() as well on the same canvas?

Thanks a lot,

---

<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:** [March 4, 2024, 11:49am UTC](https://root-forum.cern.ch/t/drawing-polymarkers-from-different-tspectrum-search-on-same-canvas/58375/2 "2024-03-04T11:49:58Z")

</div>

This example does that:  
[https://root.cern/doc/master/peaks\_8C.html](https://root.cern/doc/master/peaks_8C.html)
