I’m trying to create a series of histograms by looping through a data frame and plotting each entry as a histogram. There is 20 different plots, so it would be inconvenient to not use a loop.
In the Makie docs, it shows that you can use hist(f[1,1], X, bins = 100) and create individual plots in loop that way, but then I can’t make any adjustments to the axis.
I tried adding a separate axis call in the loop, and I get a method error:
ERROR: MethodError: no method matching iterate(::Makie.Axis)
N,cols = size(df)
ind = CartesianIndices(reshape(1:N,:,5))
fig = Figure(resolution = (1200,900))
for xi in 1:N
ax = Makie.Axis(fig[ind[xi][1],ind[xi][2]]; aspect = DataAspect());
hist(ax, df[xi,6], bins = 100)
end
display(fig)
Any suggestions on how to make adjustments to the axis in a loop?
I’m running Julia v1.9.3 on Windows 10 and using CairoMakie v0.10.12