# Weighted Histogram not being generated as smooth curve using draw option "c"

**URL:** <https://root-forum.cern.ch/t/weighted-histogram-not-being-generated-as-smooth-curve-using-draw-option-c/41428>\
**Category:** Newbie\
**Tags:** cling, hist, root\
**Created:** [September 14, 2020, 5:32am UTC](https://root-forum.cern.ch/t/weighted-histogram-not-being-generated-as-smooth-curve-using-draw-option-c/41428 "2020-09-14T05:32:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![EkNishchey](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eknishchey/32/22008_2.png) [@EkNishchey](https://root-forum.cern.ch/u/EkNishchey)\
**Post date:** [September 14, 2020, 5:32am UTC](https://root-forum.cern.ch/t/weighted-histogram-not-being-generated-as-smooth-curve-using-draw-option-c/41428/1 "2020-09-14T05:32:59Z")

</div>

Hi there! Hope you’re doing well.  
I’ve been trying to obtain a weighted histogram through following code:

```auto
TH1F *Hist=new TH1F("Hist","Hist",100,-10,10);
for(unsigned int b=0;b<limit;b++){
	hist->Fill(neg_a[b],neg_b[b]);
}
hist->Draw("c");

```

I wanted the histogram to be generated as smooth curve by using the draw option “c” but the result that I’m getting is:

 ![smooth_not_working](https://root-forum.cern.ch/uploads/default/original/3X/8/7/87c5362ee5ee3a3c3728b873fbd87e37bbdc90b7.png)

I’ve no idea what I did wrong. If the histogram is generated without weight, it does display as a smooth curve but it’s not working for a weighted histogram.

_ROOT Version:_ 6.16/00  
_Platform:_ Ubuntu 18.04.4 LTS

---

<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:** [September 14, 2020, 7:54am UTC](https://root-forum.cern.ch/t/weighted-histogram-not-being-generated-as-smooth-curve-using-draw-option-c/41428/2 "2020-09-14T07:54:57Z")

</div>

Try the “hist” [option](https://root.cern/doc/master/classTHistPainter.html#HP01a)

```auto
 Hist->Draw("hist,c");

```
