Help with plot conversion and zooming

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

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

1 Like

Worked like a charm! Thank you!