# Makie Histogram is blank, can't even plot minimal datasets

**URL:** <https://discourse.julialang.org/t/makie-histogram-is-blank-cant-even-plot-minimal-datasets/102400>\
**Category:** New to Julia\
**Tags:** plotting, makie\
**Created:** [August 2, 2023, 2:02pm UTC](https://discourse.julialang.org/t/makie-histogram-is-blank-cant-even-plot-minimal-datasets/102400 "2023-08-02T14:02:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Axze-rgb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/axze-rgb/32/50986_2.png) [@Axze-rgb](https://discourse.julialang.org/u/Axze-rgb)\
**Post date:** [August 2, 2023, 2:02pm UTC](https://discourse.julialang.org/t/makie-histogram-is-blank-cant-even-plot-minimal-datasets/102400/1 "2023-08-02T14:02:57Z")

</div>

Hello, I couldn’t plot a histogram with 2 million points, so I downsized it. But even with 10 (ten) points, it doesn’t work. So, here is a MRE

the data

> 60  
> 60  
> 60  
> 60  
> 60  
> 60  
> 60  
> 0  
> 60  
> 60

the code, I use a Pluto notebook

> df2=CSV.read(“MAPQ.dist\_sample”, DataFrame; header = false)  
> rename!(df2,[:MAPQ])

> begin  
> CairoMakie.activate!(type = “svg”)  
> fig2 = Figure(pt\_per\_unit = 2)  
> ax2 = Axis(fig[1, 1], xlabel = “MAPQ”)  
> title2 = (“MAPQ of the hifi reads”)  
> hist!(ax2, df2.MAPQ,)  
> CairoMakie.save(“MAPG.svg”,fig)  
> fig2  
> end

Any idea of what can happen? Also, the computation time is consistently around 60 seconds. So either I found a bug (very unlikely) or my code is so bad it’s close to break reality.

I would appreciate any help.

Many thanks.

---

<div class="post-metadata">

**Author:** ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Post date:** [August 2, 2023, 2:07pm UTC](https://discourse.julialang.org/t/makie-histogram-is-blank-cant-even-plot-minimal-datasets/102400/2 "2023-08-02T14:07:54Z")

</div>

You create a figure `fig2` but link your axes to a figure called `fig`. So nothing gets plotted to `fig2`.

Also, saving can be time consuming. The code without the `save` command should be quick.

---

<div class="post-metadata">

**Author:** ![Axze-rgb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/axze-rgb/32/50986_2.png) [@Axze-rgb](https://discourse.julialang.org/u/Axze-rgb)\
**Post date:** [August 2, 2023, 2:12pm UTC](https://discourse.julialang.org/t/makie-histogram-is-blank-cant-even-plot-minimal-datasets/102400/3 "2023-08-02T14:12:07Z")

</div>

Holy … too much work for today

I just realise I can get rid of the savings and then save from the notebook

Thanks

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [August 2, 2023, 2:26pm UTC](https://discourse.julialang.org/t/makie-histogram-is-blank-cant-even-plot-minimal-datasets/102400/4 "2023-08-02T14:26:16Z")

</div>

You might have tried this many times adding a lot of axes to that figure you were saving in the process 🙂 maybe that’s what made it slow

---

<div class="post-metadata">

**Author:** ![Axze-rgb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/axze-rgb/32/50986_2.png) [@Axze-rgb](https://discourse.julialang.org/u/Axze-rgb)\
**Post date:** [August 2, 2023, 2:38pm UTC](https://discourse.julialang.org/t/makie-histogram-is-blank-cant-even-plot-minimal-datasets/102400/5 "2023-08-02T14:38:55Z")

</div>

Absolutely the result was hilariously bad
