Hi rooters,
I try to plot 2 histograms one (red line in the figure) being a subset of the other
Is there a way to remove the red lines at the beginning and the end of the “red” histogram ?
I also attached a minimal ROOT macro to generate this result
{
TH1D * h = new TH1D ("", "", 100, 0, 100);
const size_t nentry = 1000;
for (size_t i = 0; i < nentry; ++i)
{
const unsigned int r = rand () % 100;
clog << r << endl;
h->Fill (r);
}
h->Draw ();
const size_t start_bin = 20;
TH1D * h2 = new TH1D ("","", 20, start_bin, start_bin+20);
for (size_t i = 0; i < 20; ++i)
{
h2->SetBinContent (i, h->GetBinContent (start_bin+i));
}
h2->SetLineColor (kRed);
h2->Draw ("same");
}
Thanks in advance for your help,
Xavier