# Drawing histograms without vertical lines

**URL:** <https://root-forum.cern.ch/t/drawing-histograms-without-vertical-lines/55103>\
**Category:** Newbie\
**Created:** [May 30, 2023, 11:19pm UTC](https://root-forum.cern.ch/t/drawing-histograms-without-vertical-lines/55103 "2023-05-30T23:19:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abunka](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/d6d6ee/32.png) [@abunka](https://root-forum.cern.ch/u/abunka)\
**Post date:** [May 30, 2023, 11:19pm UTC](https://root-forum.cern.ch/t/drawing-histograms-without-vertical-lines/55103/1 "2023-05-30T23:19:18Z")

</div>

Hello ROOTers  
I want to draw a set of histograms without the vertical lines at the bin edges. The draw option (“][”) works for removing the first and last such lines, but I am not sure how to remove the others.  
I have tried using markers, but they do not cover the bin width which would be preferred.  
Thanks,  
A

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [May 31, 2023, 5:48am UTC](https://root-forum.cern.ch/t/drawing-histograms-without-vertical-lines/55103/2 "2023-05-31T05:48:36Z")

</div>

You can set the bin errors in x and y, and draw with the option “e” or “e2” (see below), e.g.

```auto
{
  gStyle->SetErrorX(0.5); // fraction of bin width

  const int Nbins = 12;

  auto h = new TH1F("h","test",Nbins,-4,4);
  h->FillRandom("gaus",200);

  float yerr = 0.2; // adjust accordingly; gives vertical thickness if Draw("e2") is used
  for (int i=1;i<=Nbins;++i) h->SetBinError(i,yerr);

  // h->Draw("e");
  h->SetFillColor(4);
  h->Draw("e2");
}

```

gives

 ![c1](https://root-forum.cern.ch/uploads/default/original/3X/b/0/b097650cdf5aa06e76772a279e6c16d5e0eb34c1.png)

---

<div class="post-metadata">

**Author:** ![abunka](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/d6d6ee/32.png) [@abunka](https://root-forum.cern.ch/u/abunka)\
**Post date:** [May 31, 2023, 4:55pm UTC](https://root-forum.cern.ch/t/drawing-histograms-without-vertical-lines/55103/3 "2023-05-31T16:55:35Z")

</div>

Thanks for this, just what I wanted
