# Draw pulls without error bars

**URL:** <https://root-forum.cern.ch/t/draw-pulls-without-error-bars/57272>\
**Category:** Roofit and RooStats\
**Tags:** roofit\
**Created:** [November 27, 2023, 10:10am UTC](https://root-forum.cern.ch/t/draw-pulls-without-error-bars/57272 "2023-11-27T10:10:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Riccardo\_Manfredi](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/riccardo_manfredi/32/20853_2.png) [@Riccardo\_Manfredi](https://root-forum.cern.ch/u/Riccardo_Manfredi)\
**Post date:** [November 27, 2023, 10:10am UTC](https://root-forum.cern.ch/t/draw-pulls-without-error-bars/57272/1 "2023-11-27T10:10:10Z")

</div>

Hello experts,  
I am doing a fit with roofit and I want to draw also the fit pulls. As per their definition, they should not have error bars.  
I have a RooRealVar `deltaE` and a RooPlot `xframe` on which I plot an histogram and the result of a fit. I then do

```auto
RooPlot *pull1_frame = deltaE.frame();
RooHist* hpull1 = xframe->pullHist();
pull1_frame->addPlotable(hpull1,"p");

```

but the resulting histogram is drawn with error bars, even though I use the “p” option only.  
Can anybody suggest me the trick to draw this histogram without it’s error bars?

---

<div class="post-metadata">

**Author:** ![jonas](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jonas/32/24756_2.png) [@jonas](https://root-forum.cern.ch/u/jonas)\
**Post date:** [December 1, 2023, 4:12pm UTC](https://root-forum.cern.ch/t/draw-pulls-without-error-bars/57272/3 "2023-12-01T16:12:08Z")

</div>

Hi @Riccardo_Manfredi!

The pull histogram class in RooFit is inheriting from [TGraphErrors](https://root.cern.ch/doc/master/classTGraphAsymmErrors.html). Therefore, you can easily reset the errors before plotting:

```c++
   for(int iPoint = 0; iPoint < hpull1->GetN(); ++iPoint) {
      hpull1->SetPointEYlow(iPoint, 0.0);
      hpull1->SetPointEYhigh(iPoint, 0.0);
   }

```

I hope this helps!  
Cheers,  
Jonas

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [December 15, 2023, 4:12pm UTC](https://root-forum.cern.ch/t/draw-pulls-without-error-bars/57272/4 "2023-12-15T16:12:14Z")

</div>

Closed on December 15, 2023, 4:12pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
