# (Efficient) function to create a Histogram incrementally without plotting it?

**URL:** <https://discourse.julialang.org/t/efficient-function-to-create-a-histogram-incrementally-without-plotting-it/31651>\
**Category:** Statistics\
**Created:** [November 29, 2019, 10:13am UTC](https://discourse.julialang.org/t/efficient-function-to-create-a-histogram-incrementally-without-plotting-it/31651 "2019-11-29T10:13:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Massimiliano\_Comin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/massimiliano_comin/32/10936_2.png) [@Massimiliano\_Comin](https://discourse.julialang.org/u/Massimiliano_Comin)\
**Post date:** [November 29, 2019, 10:13am UTC](https://discourse.julialang.org/t/efficient-function-to-create-a-histogram-incrementally-without-plotting-it/31651/1 "2019-11-29T10:13:16Z")

</div>

Hello,

I have many random vectors (all of the same nature/size of course) that I want to bin inside a fixed histogram. So basically I would like to incrementally fill a histogram without plotting it, in an efficient fashion.

I’ve only found the histogram function in Plots.jl, but it doesn’t seem very efficient and I don’t know how to prevent it from trying to plot, which is slow and useless (and will also crash since this code will be run on a cluster).

Can someone indicate me a module that contains such a function? Or, even better maybe, some piece of optimized code?

Thanks

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [November 29, 2019, 10:38am UTC](https://discourse.julialang.org/t/efficient-function-to-create-a-histogram-incrementally-without-plotting-it/31651/2 "2019-11-29T10:38:50Z")

</div>

Check out Onlinestats.jl  
[https://joshday.github.io/OnlineStats.jl/stable/stats\_and\_models/](https://joshday.github.io/OnlineStats.jl/stable/stats_and_models/)

---

<div class="post-metadata">

**Author:** ![Massimiliano\_Comin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/massimiliano_comin/32/10936_2.png) [@Massimiliano\_Comin](https://discourse.julialang.org/u/Massimiliano_Comin)\
**Post date:** [November 29, 2019, 4:26pm UTC](https://discourse.julialang.org/t/efficient-function-to-create-a-histogram-incrementally-without-plotting-it/31651/3 "2019-11-29T16:26:42Z")

</div>

Thank you very much for the reference !
