# Removing x-errors in histogram

**URL:** <https://root-forum.cern.ch/t/removing-x-errors-in-histogram/63099>\
**Category:** Newbie\
**Created:** [March 10, 2025, 11:58am UTC](https://root-forum.cern.ch/t/removing-x-errors-in-histogram/63099 "2025-03-10T11:58:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![phylmath](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/phylmath/32/38400_2.png) [@phylmath](https://root-forum.cern.ch/u/phylmath)\
**Post date:** [March 10, 2025, 11:58am UTC](https://root-forum.cern.ch/t/removing-x-errors-in-histogram/63099/1 "2025-03-10T11:58:09Z")

</div>

_ROOT Version:_ 6.32.04  
_Platform:_ WSL2 Ubuntu

Hello! I would like to remove the x-axis errors from a histogram. How can I do this?

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/0/1/014053f5b3a9197d30c42ea22dfb59ebb12fb9da.png)

Thanks in advance! Cheers.

---

<div class="post-metadata">

**Author:** ![yus](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/9fc348/32.png) [@yus](https://root-forum.cern.ch/u/yus)\
**Post date:** [March 10, 2025, 12:03pm UTC](https://root-forum.cern.ch/t/removing-x-errors-in-histogram/63099/2 "2025-03-10T12:03:58Z")

</div>

Hi,

try  
`gStyle->SetErrorX(0.00001);`

---

<div class="post-metadata">

**Author:** ![phylmath](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/phylmath/32/38400_2.png) [@phylmath](https://root-forum.cern.ch/u/phylmath)\
**Post date:** [March 10, 2025, 12:09pm UTC](https://root-forum.cern.ch/t/removing-x-errors-in-histogram/63099/3 "2025-03-10T12:09:42Z")

</div>

Thanks for the reply. I cannot see the difference. Since my plot contains multiple hists, does this command apply to all of them? For reference, a snippet of my code.

```auto
// Create canvas
TCanvas* c_nch = new TCanvas("c_nch", " ", 800, 600);
// Draw
c_nch->cd();
hist_nChPyZ0->Draw("PS");
hist_nChExLZ->Draw("same");
hist_nChExOZ->Draw("same");
hist_nChPy2W->Draw("same");
hist_nChExLW->Draw("same");
hist_nChExOW->Draw("same");
// Modify
gStyle->SetOptStat();
gStyle->SetErrorX(0.00001);

```

Is there a histogram-specific command that I could use before plotting itself?

---

<div class="post-metadata">

**Author:** ![phylmath](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/phylmath/32/38400_2.png) [@phylmath](https://root-forum.cern.ch/u/phylmath)\
**Post date:** [March 10, 2025, 12:11pm UTC](https://root-forum.cern.ch/t/removing-x-errors-in-histogram/63099/4 "2025-03-10T12:11:11Z")

</div>

Sorry, got it now. I added the `c_nch->Modified();` command and it works 🙂

---

<div class="post-metadata">

**Author:** ![yus](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/9fc348/32.png) [@yus](https://root-forum.cern.ch/u/yus)\
**Post date:** [March 10, 2025, 12:11pm UTC](https://root-forum.cern.ch/t/removing-x-errors-in-histogram/63099/5 "2025-03-10T12:11:26Z")

</div>

Try moving the line with `TStyle::SetErrorX()` before the lines with `TH1::Draw()`.
