Skip to content

Conversation

@mfarrington1
Copy link

@mfarrington1 mfarrington1 commented Dec 12, 2025

Implemented a temporary workaround so you can use stackedhist! in combination with setting the Makie axis scale to yscale=log10

An example of how the plotting looks can be seen here

begin
       hist1 = Hist1D(bincounts=[1e10, 1e3, 1e2, 1]; binedges=1:5)
       hist2 = Hist1D(bincounts=[9e10, 1e8, 1e6, 1e3]; binedges=1:5)
       CairoMakie.activate!(type="png")
       fig = CairoMakie.Figure()
       ax = CairoMakie.Axis(fig[1,1], yscale=log10, limits=((1,5), (1, 1e13)))
       hist_labels = ["hist1", "hist2"]
       stackedhist!(ax, [hist1, hist2])
       elements = [PolyElement(polycolor = Makie.wong_colors()[i]) for i in 1:length(hist_labels)]
       Legend(fig[1,2], elements, hist_labels)
       CairoMakie.current_figure()
end
image

@github-actions
Copy link
Contributor

Benchmark Results (Julia v1)

Time benchmarks
main 8cf59d4... main / 8cf59d4...
Non-Uniform Binning/One-shot Gaussian input 16.3 ± 0.047 ms 16.6 ± 0.087 ms 0.982 ± 0.0059
Non-Uniform Binning/One-shot Gaussian input with weights 16.8 ± 0.074 ms 17.2 ± 0.13 ms 0.976 ± 0.0083
Non-Uniform Binning/One-shot Uniform input 14.9 ± 0.093 ms 15.3 ± 0.14 ms 0.978 ± 0.011
Non-Uniform Binning/One-shot Uniform input with weights 15.1 ± 0.074 ms 15.2 ± 0.55 ms 0.993 ± 0.036
Uniform Binning/One-shot Gaussian input 6.49 ± 0.054 ms 6.56 ± 0.082 ms 0.99 ± 0.015
Uniform Binning/One-shot Gaussian input with weights 9.97 ± 0.074 ms 9.88 ± 0.079 ms 1.01 ± 0.011
Uniform Binning/One-shot Uniform input 1.96 ± 0.043 ms 1.96 ± 0.028 ms 1 ± 0.027
Uniform Binning/One-shot Uniform input with weights 5.52 ± 0.13 ms 5.54 ± 0.19 ms 0.998 ± 0.042
Uniform Binning/atomic_push!-loop Gaussian input 19.3 ± 0.17 ms 19.3 ± 0.089 ms 0.999 ± 0.0097
Uniform Binning/push!-loop Uniform input 2.43 ± 0.042 ms 2.43 ± 0.031 ms 1 ± 0.022
time_to_load 0.272 ± 0.0024 s 0.279 ± 0.0027 s 0.974 ± 0.013
Memory benchmarks
main 8cf59d4... main / 8cf59d4...
Non-Uniform Binning/One-shot Gaussian input 11 allocs: 0.469 kB 11 allocs: 0.469 kB 1
Non-Uniform Binning/One-shot Gaussian input with weights 11 allocs: 0.469 kB 11 allocs: 0.469 kB 1
Non-Uniform Binning/One-shot Uniform input 11 allocs: 0.469 kB 11 allocs: 0.469 kB 1
Non-Uniform Binning/One-shot Uniform input with weights 11 allocs: 0.469 kB 11 allocs: 0.469 kB 1
Uniform Binning/One-shot Gaussian input 10 allocs: 0.547 kB 10 allocs: 0.547 kB 1
Uniform Binning/One-shot Gaussian input with weights 10 allocs: 0.547 kB 10 allocs: 0.547 kB 1
Uniform Binning/One-shot Uniform input 10 allocs: 0.547 kB 10 allocs: 0.547 kB 1
Uniform Binning/One-shot Uniform input with weights 10 allocs: 0.547 kB 10 allocs: 0.547 kB 1
Uniform Binning/atomic_push!-loop Gaussian input 7 allocs: 0.344 kB 7 allocs: 0.344 kB 1
Uniform Binning/push!-loop Uniform input 7 allocs: 0.344 kB 7 allocs: 0.344 kB 1
time_to_load 0.145 k allocs: 11 kB 0.145 k allocs: 11 kB 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant