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

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.

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.

2 Likes

Holy … too much work for today

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

Thanks

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

2 Likes

Absolutely the result was hilariously bad