# Histogram in RDataFrame is not drawn

**URL:** <https://root-forum.cern.ch/t/histogram-in-rdataframe-is-not-drawn/55216>\
**Category:** Newbie\
**Tags:** rdataframe\
**Created:** [June 7, 2023, 9:14am UTC](https://root-forum.cern.ch/t/histogram-in-rdataframe-is-not-drawn/55216 "2023-06-07T09:14:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![beg1nner](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/d26b3c/32.png) [@beg1nner](https://root-forum.cern.ch/u/beg1nner)\
**Post date:** [June 7, 2023, 9:14am UTC](https://root-forum.cern.ch/t/histogram-in-rdataframe-is-not-drawn/55216/1 "2023-06-07T09:14:45Z")

</div>

Hello,

I am trying to do the simplest thing ever - read the histogram from an ntuple and simply draw it with RDataFrame.  
I am using this code:

```auto
using namespace ROOT;

void test(){
 RDataFrame df("Events", "tree_1.root");
 auto hist = df.Histo1D("Muon_pt");
 hist->Draw();
}

```

I thought that maybe it is because of absent TCanvas, but I also tried it that way - still does not work. The script goes through without errors, but there is no output. I am using simply `root -l test.cpp` command.  
I tried with ROOT 6.24/06 and 6.24/08.

Could you please help me to figure out what’s wrong? Thank you!!

---

<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:** [June 7, 2023, 9:19am UTC](https://root-forum.cern.ch/t/histogram-in-rdataframe-is-not-drawn/55216/2 "2023-06-07T09:19:26Z")

</div>

may be:

```auto
hist->DrawClone();

```

?

---

<div class="post-metadata">

**Author:** ![beg1nner](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/d26b3c/32.png) [@beg1nner](https://root-forum.cern.ch/u/beg1nner)\
**Post date:** [June 7, 2023, 9:29am UTC](https://root-forum.cern.ch/t/histogram-in-rdataframe-is-not-drawn/55216/3 "2023-06-07T09:29:51Z")

</div>

Unfortunately, still does not work.  
Here is the link to the ntuple, may be it will be helpful to recreate the problem:

> **[48.39 MB file on MEGA](https://mega.nz/file/zzhxXawI#dHJQ_jYQ73g7XWx3pF0PHA_qfak0f2DLw2cUuY5U0kA)**

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [June 7, 2023, 9:53am UTC](https://root-forum.cern.ch/t/histogram-in-rdataframe-is-not-drawn/55216/4 "2023-06-07T09:53:25Z")

</div>

Dear @beg1nner ,

I can see the histogram with `DrawClone`

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/8/4/841d8810f29b0a0c40e0edb5426889a94acb8d0d.png)

Cheers,  
Vincenzo
