# Histogram draw (draw a simple line connecting all histogram bin points)

**URL:** <https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744>\
**Category:** Newbie\
**Created:** [October 7, 2020, 3:58am UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744 "2020-10-07T03:58:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![NewRootUser](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/9fc348/32.png) [@NewRootUser](https://root-forum.cern.ch/u/NewRootUser)\
**Post date:** [October 7, 2020, 3:58am UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/1 "2020-10-07T03:58:21Z")

</div>

I have 3 histogram and 1 graph file. I want to draw the line between the histogram bins directly as it is drawn in case of graph. How can I modify the following code.  
I’m attaching the file and result file as well [rootf.zip](https://root-forum.cern.ch/uploads/short-url/9xYCZ8ZJD7r2kK4mGuNNe2qXI5l.zip) (58.0 KB) .

 ![c1](https://root-forum.cern.ch/uploads/default/original/3X/8/d/8d037cd6a23727f911ff505a051556beeea9cad8.png)

```auto
{
  TFile *f1 = TFile::Open("N.root");
   TCanvas *c = (TCanvas *)f1->Get("c1");
   TGraphErrors *g1 = (TGraphErrors *)c->GetListOfPrimitives()->FindObject("Graph");
   c->Close();
  g1->GetXaxis()->SetRangeUser(0,6);
 g1->GetYaxis()->SetRangeUser(1,1000);
   
   g1->SetMarkerStyle(23);
   g1->Draw("L");
   g1->GetXaxis()->SetNdivisions(509);
   gPad->SetLogy();

 
   TFile *f2 = TFile::Open("hist1.root");
   TH1D* h1 = (TH1D*)f2->Get("h16");
   h1->Draw("hist same");
   h1->SetLineStyle(10);
   h1->SetMarkerStyle(26);
   h1->SetLineColor(9);
   h1->SetLineWidth(2);

   TFile *f3 = TFile::Open("hist2.root");
   TH1D* h2 = (TH1D*)f3->Get("h16");
   h2->Draw("hist same");
   h2->SetName("b");
   h2->SetLineStyle(9);
   h2->SetMarkerStyle(29);
   h2->SetLineColor(1);
   h2->SetLineWidth(2);

   TFile *f4 = TFile::Open("hist3.root");
   TH1D* h3 = (TH1D*)f4->Get("h16");
   h3->Draw("hist same");
   h3->SetName("b");
   h3->SetLineStyle(8);
   h3->SetMarkerStyle(24);
   h3->SetLineColor(80);
   h3->SetLineWidth(2);

   auto leg = new TLegend(0.51,0.69,0.9,0.9);
   leg->SetHeader("Final");
   leg->AddEntry(g1,"graph","p");
   leg->AddEntry(h1, "hist1","l");
   leg->AddEntry(h2, "hist2","l");
   leg->AddEntry(h3,"hist3","l");
  
   leg->SetFillColor(10);
   leg->Draw();
}

```

Thanks. Looking forward for the answer.

_ROOT Version:_ 16.04  
_Platform:_ Ubuntu 20.04  
_Compiler:_ Not Provided

* * *

---

<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:** [October 7, 2020, 5:30am UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/2 "2020-10-07T05:30:46Z")

</div>

Try including theoption “L” when drawing them.

> **[ROOT: THistPainter Class Reference](https://root.cern/doc/master/classTHistPainter.html#HP01)**

---

<div class="post-metadata">

**Author:** ![NewRootUser](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/9fc348/32.png) [@NewRootUser](https://root-forum.cern.ch/u/NewRootUser)\
**Post date:** [October 7, 2020, 6:26am UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/4 "2020-10-07T06:26:53Z")

</div>

Thanks for the reply but this does not work. I have tried all the options and the above-shown fig is the best what I got. Draw panel helps to get a marker at the peak of each bar but the issue of connecting line remains the same.

---

<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:** [October 7, 2020, 6:57am UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/5 "2020-10-07T06:57:50Z")

</div>

This

```auto
void aa()
{
   auto C = new TCanvas();
 
   gStyle->SetOptTitle(kFALSE);
   gStyle->SetOptStat(0);
 
   auto h1 = new TH1F ("h1","Histogram drawn with full circles",5,-4,4);
   auto h2 = new TH1F ("h2","Histogram drawn with full squares",5,-4,4);
 
   TRandom3 rng;
   Double_t px,py;
   for (Int_t i = 0; i < 25000; i++) {
      rng.Rannor(px,py);
      h1->Fill(px,10.);
      h2->Fill(px, 8.);
   }
   h1->SetMarkerStyle(kFullCircle);
   h2->SetMarkerStyle(kFullSquare);

h1->SetLineStyle(10);
h1->SetMarkerStyle(26);
h1->SetLineColor(9);
h1->SetLineWidth(2);
h2->SetLineStyle(9);
h2->SetMarkerStyle(29);
h2->SetLineColor(1);
h2->SetLineWidth(2);

   h1->Draw("HIST L P");
   h2->Draw("HIST L P SAME");

   gPad->BuildLegend();
}

```

gives

 ![c1](https://root-forum.cern.ch/uploads/default/original/3X/2/5/25a058fd2a8adc1367aa4cef330238928c90910a.png)

---

<div class="post-metadata">

**Author:** ![NewRootUser](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/9fc348/32.png) [@NewRootUser](https://root-forum.cern.ch/u/NewRootUser)\
**Post date:** [October 7, 2020, 8:15am UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/6 "2020-10-07T08:15:17Z")

</div>

Thanks, it works but with new problems. The TGraph and TLegend got disappear.  
This is what I got. ![c](https://root-forum.cern.ch/uploads/default/original/3X/a/3/a3f00ff45d0c7ec8a7851ef08bd07d31a0859626.png)

```auto

{
   TFile *f1 = TFile::Open("N.root");
   TCanvas *c = (TCanvas *)f1->Get("c1");
   TGraphErrors *g1 = (TGraphErrors *)c->GetListOfPrimitives()->FindObject("Graph");
   c->Close();
  g1->GetXaxis()->SetRangeUser(0,6);
 g1->GetYaxis()->SetRangeUser(1,1000);
   
   g1->SetMarkerStyle(23);
   //g1->Draw("AP");
   g1->SetLineColor(7);
   g1->SetLineWidth(2);
   g1->Draw("AP");
   g1->GetXaxis()->SetNdivisions(509);
   gPad->SetLogy();
 
   TFile *f2 = TFile::Open("hist1.root");
   TH1D* h1 = (TH1D*)f2->Get("h16");
   h1->Draw("hist same");
   h1->SetMarkerStyle(kFullCircle);
   h1->SetLineStyle(10);
h1->SetMarkerStyle(26);
h1->SetLineColor(9);
h1->SetLineWidth(2);
h1->Draw("HIST L P");
 
   TFile *f3 = TFile::Open("hist2.root");
   TH1D* h2 = (TH1D*)f3->Get("h16");
   h2->SetMarkerStyle(kFullSquare);
   h2->SetLineStyle(9);
h2->SetMarkerStyle(29);
h2->SetLineColor(1);
h2->SetLineWidth(2);
h2->Draw("HIST L P SAME");
   
 
      auto leg = new TLegend(0.51,0.69,0.9,0.9);
   leg->SetHeader("Final");
   leg->AddEntry(g1,"graph","");
      leg->AddEntry(h1, "hist1","l");
      leg->AddEntry(h1, "hist1","l");
}

```

---

<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:** [October 7, 2020, 8:19am UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/7 "2020-10-07T08:19:48Z")

</div>

We are missing the ROOT files to be ables to run your macro.

---

<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:** [October 7, 2020, 8:21am UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/8 "2020-10-07T08:21:23Z")

</div>

You are missing a `SAME` here:

```auto
   h1->Draw("HIST L P");

```

This command will start a new plot.  
and you draw h1 twice …  
and you put h1 twice in the legend … weird

---

<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:** [October 7, 2020, 8:25am UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/9 "2020-10-07T08:25:01Z")

</div>

```auto
{
   TFile *f1 = TFile::Open("N.root");
   TCanvas *c = (TCanvas *)f1->Get("c1");
   TGraphErrors *g1 = (TGraphErrors *)c->GetListOfPrimitives()->FindObject("Graph");
   c->Close();
   g1->GetXaxis()->SetRangeUser(0,6);
   g1->GetYaxis()->SetRangeUser(1,1000);

   g1->SetMarkerStyle(23);
   g1->SetLineColor(7);
   g1->SetLineWidth(2);
   g1->Draw("AP");
   g1->GetXaxis()->SetNdivisions(509);
   gPad->SetLogy();

   TFile *f2 = TFile::Open("hist1.root");
   TH1D* h1 = (TH1D*)f2->Get("h16");
   h1->SetMarkerStyle(kFullCircle);
   h1->SetLineStyle(10);
   h1->SetMarkerStyle(26);
   h1->SetLineColor(9);
   h1->SetLineWidth(2);
   h1->Draw("HIST L P SAME");

   TFile *f3 = TFile::Open("hist2.root");
   TH1D* h2 = (TH1D*)f3->Get("h16");
   h2->SetMarkerStyle(kFullSquare);
   h2->SetLineStyle(9);
   h2->SetMarkerStyle(29);
   h2->SetLineColor(1);
   h2->SetLineWidth(2);
   h2->Draw("HIST L P SAME");

   auto leg = new TLegend(0.51,0.69,0.9,0.9);
   leg->SetHeader("Final");
   leg->AddEntry(g1,"graph","");
   leg->AddEntry(h1, "hist1","l");
   leg->AddEntry(h2, "hist2","l");
}

```

---

<div class="post-metadata">

**Author:** ![NewRootUser](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/9fc348/32.png) [@NewRootUser](https://root-forum.cern.ch/u/NewRootUser)\
**Post date:** [October 7, 2020, 9:08am UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/10 "2020-10-07T09:08:42Z")

</div>

Thanks, it worked. Just TLegend missing. ![co](https://root-forum.cern.ch/uploads/default/original/3X/4/0/40f5f8408395e968665f96cdf1219ec655dbb0a3.png)  
In case if you need the root file, here they are;  
[hist1.root](https://root-forum.cern.ch/uploads/short-url/tC8pHI00QIzq0HuSGwn6W2ME0Ox.root) (43.6 KB) [hist2.root](https://root-forum.cern.ch/uploads/short-url/zGeXtUQgICLYXT32fQJNaGyDQS7.root) (44.0 KB) [N.root](https://root-forum.cern.ch/uploads/short-url/rLY9lxYF4gQ6XlLj3WeW3gTw4gX.root) (8.2 KB)

---

<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:** [October 7, 2020, 11:18am UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/11 "2020-10-07T11:18:08Z")

</div>

of course you should draw the legend at the end:

```auto
   leg->Draw();

```

---

<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:** [October 7, 2020, 11:23am UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/12 "2020-10-07T11:23:23Z")

</div>

```auto
{
   TFile *f1 = TFile::Open("N.root");
   TCanvas *c = (TCanvas *)f1->Get("c1");
   TGraphErrors *g1 = (TGraphErrors *)c->GetListOfPrimitives()->FindObject("Graph");
   c->Close();
   g1->GetXaxis()->SetRangeUser(0,6);
   g1->GetYaxis()->SetRangeUser(1,1000);

   g1->SetMarkerStyle(23);
   g1->SetLineColor(7);
   g1->SetLineWidth(2);
   g1->Draw("APL");
   g1->GetXaxis()->SetNdivisions(509);
   gPad->SetLogy();

   TFile *f2 = TFile::Open("hist1.root");
   TH1D* h1 = (TH1D*)f2->Get("h16");
   h1->SetMarkerStyle(kFullCircle);
   h1->SetLineStyle(10);
   h1->SetMarkerStyle(26);
   h1->SetLineColor(9);
   h1->SetLineWidth(2);
   h1->Draw("HIST L P SAME");

   TFile *f3 = TFile::Open("hist2.root");
   TH1D* h2 = (TH1D*)f3->Get("h16");
   h2->SetMarkerStyle(kFullSquare);
   h2->SetLineStyle(9);
   h2->SetMarkerStyle(29);
   h2->SetLineColor(1);
   h2->SetLineWidth(2);
   h2->Draw("HIST L P SAME");

   auto leg = new TLegend(0.5,0.2,0.85,0.4);
   leg->SetHeader("Final");
   leg->AddEntry(g1,"graph","PL");
   leg->AddEntry(h1, "hist1","PL");
   leg->AddEntry(h2, "hist2","PL");
   leg->Draw();
}

```

 ![Screenshot 2020-10-07 at 13.22.29](https://root-forum.cern.ch/uploads/default/original/3X/e/0/e0e1ba549ba04a981338763109966a5006fcb640.jpeg)

---

<div class="post-metadata">

**Author:** ![NewRootUser](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/9fc348/32.png) [@NewRootUser](https://root-forum.cern.ch/u/NewRootUser)\
**Post date:** [October 7, 2020, 11:50am UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/13 "2020-10-07T11:50:43Z")

</div>

Thank you to point out my silly mistake. 😃

---

<div class="post-metadata">

**Author:** ![NewRootUser](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/9fc348/32.png) [@NewRootUser](https://root-forum.cern.ch/u/NewRootUser)\
**Post date:** [October 10, 2020, 8:57am UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/14 "2020-10-10T08:57:57Z")

</div>

Hello,  
I tried with other root files and got 2 problems.  
1st- When I tried with these files ([1.root](https://root-forum.cern.ch/uploads/short-url/1pgsV2DcWa1waM2tb0mcN2uKZn.root) (14.6 KB) [2.root](https://root-forum.cern.ch/uploads/short-url/aArejxOURl1g8ycGEyWexh8cwsi.root) (44.2 KB) [m1.C](https://root-forum.cern.ch/uploads/short-url/hBFhf61a5ElRUEQs1SAwrbSjgWJ.C) (850 Bytes) ) i got this result.

 ![c1](https://root-forum.cern.ch/uploads/default/original/3X/8/5/850e7593ef43e26fae4b6cafb00758a2a318d75f.png)  
If I open this in TBrowser it shows the 2.root file has value at x=1 but here it’s not included.

2nd- I created c1.root file from c1.C file which has only one value(at x=5). When I draw this with hist. 2 or3.root, it create results for x=5-6 range only. How it should be modified for getting the x=1-5 range. [c1.C](https://root-forum.cern.ch/uploads/short-url/ujsFgorN6QB9NzyuZ9SCIc4KG1D.C) (211 Bytes) [c1.root](https://root-forum.cern.ch/uploads/short-url/pN6xWyBjNT04DvUnKrpe1LXypD1.root) (14.5 KB) [m1.C](https://root-forum.cern.ch/uploads/short-url/yUrUhUxUpWgVE58B8eC3xtFSJPg.C) (852 Bytes)

 ![x5](https://root-forum.cern.ch/uploads/default/original/3X/f/7/f7caf2fccedc0d6ae40ea6579f1dfbc476b54ab8.png)  
I tried to define the range for h1 but it does not work.

---

<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:** [October 12, 2020, 1:51pm UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/15 "2020-10-12T13:51:09Z")

</div>

> [@NewRootUser](#):
>
> If I open this in TBrowser it shows the 2.root file has value at x=1 but here it’s not included.

I do not understand what you mean… 2.root contains 21 TH1D

> [@NewRootUser](#):
>
> 2nd- I created c1.root file from c1.C

You file c1.root does not correspond to c1.C. When I recreate c1.root for c1.C I get the same plot.

---

<div class="post-metadata">

**Author:** ![NewRootUser](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/9fc348/32.png) [@NewRootUser](https://root-forum.cern.ch/u/NewRootUser)\
**Post date:** [October 12, 2020, 2:39pm UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/16 "2020-10-12T14:39:14Z")

</div>

1st problem - 2.root(check h16 histogram) has some value for x=1 but the line starts from x=2(which has bin value zero) in the canvas and x=1 point values are not present in this.

---

<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:** [October 12, 2020, 2:53pm UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/17 "2020-10-12T14:53:47Z")

</div>

I do not see any problem with h16. Can you tell me which Drawing comment you are using ?

---

<div class="post-metadata">

**Author:** ![NewRootUser](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/9fc348/32.png) [@NewRootUser](https://root-forum.cern.ch/u/NewRootUser)\
**Post date:** [October 12, 2020, 3:50pm UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/18 "2020-10-12T15:50:57Z")

</div>

1st - If you draw [2.root](https://root-forum.cern.ch/uploads/short-url/aArejxOURl1g8ycGEyWexh8cwsi.root) (h16 histogram)(44.2 KB) and [1.root](https://root-forum.cern.ch/uploads/short-url/1pgsV2DcWa1waM2tb0mcN2uKZn.root) (14.6 KB) root files using [m1.C](https://root-forum.cern.ch/uploads/short-url/hBFhf61a5ElRUEQs1SAwrbSjgWJ.C) (850 Bytes) then we will get this result

 ![20201012_211200](https://root-forum.cern.ch/uploads/default/original/3X/2/c/2cedf6131f6cc440abfac22c397f7e5c96ab7935.png)

The highlighted point should be connected with other points of the same line(blue line) but line itself starts from point 2.

---

<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:** [October 13, 2020, 8:19am UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/19 "2020-10-13T08:19:26Z")

</div>

```auto

   TFile *f1 = TFile::Open("1.root");
   TCanvas *c = (TCanvas *)f1->Get("c1");
   TGraphErrors *g1 = (TGraphErrors *)c->GetListOfPrimitives()->FindObject("Graph");
   c->Close();
   g1->GetXaxis()->SetRangeUser(0,6);
   g1->GetYaxis()->SetRangeUser(-1,200);

   g1->SetMarkerStyle(22);
   g1->SetLineColor(2);
   g1->SetLineWidth(3);
   g1->SetLineStyle(9);
   g1->Draw("");
   g1->GetXaxis()->SetNdivisions(509);

   TFile *f2 = TFile::Open("2.root");
   TH1D* h1 = (TH1D*)f2->Get("h16");
   h1->SetLineStyle(9);
   h1->SetMarkerStyle(21);
   h1->SetLineColor(9);
   h1->SetLineWidth(3);
   h1->Draw("HIST L P SAME");

   auto leg = new TLegend(0.6,0.69,0.9,0.9);
   leg->SetHeader("R");
   leg->AddEntry(g1,"1","l p");
   leg->AddEntry(h1, "2","a p l");
   leg->Draw();
}

```

 ![Screenshot 2020-10-13 at 10.18.45](https://root-forum.cern.ch/uploads/default/original/3X/2/4/2449a309b5ceedd479bece232d7102b22e6387ee.jpeg)

---

<div class="post-metadata">

**Author:** ![NewRootUser](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/9fc348/32.png) [@NewRootUser](https://root-forum.cern.ch/u/NewRootUser)\
**Post date:** [October 14, 2020, 6:26am UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/20 "2020-10-14T06:26:00Z")

</div>

Thanks @couet.  
2nd- In this case I want to set range of canvas from x=1-5. c1.root [c1.root](https://root-forum.cern.ch/uploads/short-url/pN6xWyBjNT04DvUnKrpe1LXypD1.root) (14.5 KB) has single value(x=5) and 2.root(h16)[2.root](https://root-forum.cern.ch/uploads/short-url/aArejxOURl1g8ycGEyWexh8cwsi.root) (44.2 KB) has x=1-5 values. How can I do it using this [m1.C](https://root-forum.cern.ch/uploads/short-url/yUrUhUxUpWgVE58B8eC3xtFSJPg.C) (852 Bytes) ? I tried to modify h1 range but didn’t work.

---

<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:** [October 14, 2020, 9:03am UTC](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744/21 "2020-10-14T09:03:20Z")

</div>

you sent 1.root and 2.root but your macro access c1.root and 3.root

[Next page](https://root-forum.cern.ch/t/histogram-draw-draw-a-simple-line-connecting-all-histogram-bin-points/41744.md?page=2)
