# Why does histogram produce a line plot?

**URL:** https://discourse.julialang.org/t/why-does-histogram-produce-a-line-plot/96191
**Category:** New to Julia
**Created:** [March 16, 2023, 3:37pm UTC](https://discourse.julialang.org/t/why-does-histogram-produce-a-line-plot/96191 "2023-03-16T15:37:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![chadagreene](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chadagreene/32/34924_2.png) [@chadagreene](https://discourse.julialang.org/u/chadagreene)
#### Post date: [March 16, 2023, 3:37pm UTC](https://discourse.julialang.org/t/why-does-histogram-produce-a-line-plot/96191/1 "2023-03-16T15:37:32Z")

</div>

I have a dataframe `df` and I’m trying to plot a histogram of all the values in the third column of `df` like this:

```julia
using Plots 
histogram(df[:,3])

```

I am expecting the histogram to appear as bars, but instead it gets plotted as this line:  
 ![test](https://global.discourse-cdn.com/julialang/original/3X/2/d/2d5a42486cafe7d2788c97401775da297c508b47.png)

What’s going on here? How do I encourage the `histogram` function to plot the histogram as a standard bar plot?

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [March 16, 2023, 3:55pm UTC](https://discourse.julialang.org/t/why-does-histogram-produce-a-line-plot/96191/2 "2023-03-16T15:55:11Z")

</div>

That’s just the default behaviour for when you have more than 1 million values - essentially the histogram turns into a density at those very fine resolutions.

You can pass `fill = true` if you just want to fill the area under the curve, not sure how you get the actual bars to show but imho it doesn’t look great when the bars are hardly wider than their outlines - this is what it looks like for 1m observations, where bars are still plotted:

![image](https://global.discourse-cdn.com/julialang/original/3X/9/8/989322ca1afebae3e08b3ade1b8dfd8ecbfbe9b8.png)

---

<div class="post-metadata">

### Author: ![chadagreene](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chadagreene/32/34924_2.png) [@chadagreene](https://discourse.julialang.org/u/chadagreene)
#### Post date: [March 16, 2023, 4:20pm UTC](https://discourse.julialang.org/t/why-does-histogram-produce-a-line-plot/96191/3 "2023-03-16T16:20:46Z")

</div>

Thanks @nilshg! Are the optional input arguments for `histogram` documented somewhere that I’m missing?
