# Histogram pattern

**URL:** <https://root-forum.cern.ch/t/histogram-pattern/38776>\
**Category:** Newbie\
**Tags:** hist\
**Created:** [April 8, 2020, 3:43pm UTC](https://root-forum.cern.ch/t/histogram-pattern/38776 "2020-04-08T15:43:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![phy.vijayraj](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/phy.vijayraj/32/18580_2.png) [@phy.vijayraj](https://root-forum.cern.ch/u/phy.vijayraj)\
**Post date:** [April 8, 2020, 3:43pm UTC](https://root-forum.cern.ch/t/histogram-pattern/38776/1 "2020-04-08T15:43:47Z")

</div>

Dear Sir/Madam,

I need your help in understanding the style of histogram. It look like a filled histogram. I want to explain in a brief,  
I recently performed an experiment. The data is in .dat format with two columns. Column 1 (say X) is the channel numbers, and 2nd (say Y) are the counts. I can plot the dat file using TGraph or even in any graphical software. But, I love to learn root. I have generated root file using two basic examples (basic.C / basic2.C). Which in principle are the examples of Tree.

The code I am using is attached herewith. When it generate the root file, I can see the histograph (h1) but it looks like a filled with blue color. Please have a look (h1). I want a clean histogram. Is there any way. I will be highly obliged for your help.  
With this mail, please find 2nd round data file in dat format(compressed), code I used to create root file and a root file.

Much Regards  
VJ  
[13MeV-Ge-19-03-2020.dat.tar.gz](https://root-forum.cern.ch/uploads/short-url/rc51WQFT1RPZZry3DJ9XozagAVV.gz) (24.8 KB)  
[hist.C](https://root-forum.cern.ch/uploads/short-url/5zjl97T5ekSRzxFlZ1AUS6RO4aU.C) (374 Bytes) [1.root](https://root-forum.cern.ch/uploads/short-url/gCI0cmWDccLzEAy51D6Rz35r0J1.root) (48.8 KB)

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [April 8, 2020, 4:46pm UTC](https://root-forum.cern.ch/t/histogram-pattern/38776/2 "2020-04-08T16:46:13Z")

</div>

> [@How I can convert dat file to root file](https://root-forum.cern.ch/t/how-i-can-convert-dat-file-to-root-file/37793/2):
>
> { TGraph \*g = new TGraph("10B27Al-120MeV-Ge-8.dat"); g-\>SetTitle("Sample title;channel number;#counts"); Int\_t T\_real = g-\>GetY()[0]; g-\>GetY()[0] = 0; Int\_t T\_vivo = g-\>GetY()[1]; g-\>GetY()[1] = 0; std::cout \<\< "Espectro en: " \<\< g-\>GetN() \<\< " canales" \<\< std::endl; std::cout \<\< "T real: " \<\< T\_real \<\< " s" \<\< std::endl; std::cout \<\< "T vivo: " \<\< T\_vivo \<\< " s" \<\< std::endl; g-\>Draw("ALP"); // g-\>SetMinimum(1); gPad-\>SetLogy(1); }

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 9, 2020, 6:37am UTC](https://root-forum.cern.ch/t/histogram-pattern/38776/3 "2020-04-09T06:37:26Z")

</div>

I think you want to see y vs x, right ?

in that case the Draw command should be:

```auto
   T->Draw("y:x","","L");

```

See the help of `TTree::Draw`.

This command gives me the following plot:

 ![Screenshot 2020-04-09 at 08.34.55](https://root-forum.cern.ch/uploads/default/original/3X/c/1/c1433c62ba7a9aa3bfb5a8030ff11e197c5db9c0.png)

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [April 9, 2020, 8:17am UTC](https://root-forum.cern.ch/t/histogram-pattern/38776/4 "2020-04-09T08:17:19Z")

</div>

@couet The first two data points should be skipped (see the macro in my previous post).
