# Help with plot conversion and zooming

**URL:** <https://root-forum.cern.ch/t/help-with-plot-conversion-and-zooming/48827>\
**Category:** Newbie\
**Created:** [February 16, 2022, 8:57pm UTC](https://root-forum.cern.ch/t/help-with-plot-conversion-and-zooming/48827 "2022-02-16T20:57:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nisha](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/nisha/32/28801_2.png) [@Nisha](https://root-forum.cern.ch/u/Nisha)\
**Post date:** [February 16, 2022, 8:57pm UTC](https://root-forum.cern.ch/t/help-with-plot-conversion-and-zooming/48827/1 "2022-02-16T20:57:45Z")

</div>

Hello,

I am in the process of learning root. I came across the following issues I am having a little trouble with.

1. I have a histogram with multiple peaks, Is there a way to convert the histogram to a graph? Can anyone suggest to me how to do that?
2. For the histogram with multiple peaks, I need to zoom in for each peak and create a pdf to save them separately. I tried changing the range, something like this, but it did not work,

hTVsC\_backsub-\>GetXaxis()-\>SetRange(min,max);

```
Double_t binmaxY = hTVsC_backsub->GetMaximumBin();

Double_t binmaxX = hTVsC_backsub->GetBinCenter(binmaxY);

```

Can anyone help with these questions? Apologies, these are probably very straight forward but I am not sure how to proceed. Any help is appreciated. Thank you so much for your time!

\_ ROOT Version:\* 6.18/04  
Platform:\* C++  
Compiler:\* Visual Studio Code

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [February 16, 2022, 9:56pm UTC](https://root-forum.cern.ch/t/help-with-plot-conversion-and-zooming/48827/2 "2022-02-16T21:56:27Z")

</div>

Try: `hTVsC_backsub->GetXaxis()->SetRangeUser(some_x_min, some_x_max);`

---

<div class="post-metadata">

**Author:** ![Nisha](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/nisha/32/28801_2.png) [@Nisha](https://root-forum.cern.ch/u/Nisha)\
**Post date:** [February 18, 2022, 1:37am UTC](https://root-forum.cern.ch/t/help-with-plot-conversion-and-zooming/48827/3 "2022-02-18T01:37:06Z")

</div>

Worked like a charm! Thank you!
