I see you are using ROOT, my how that brings back memories.

The Plots.jl package wraps lots of other plotting libraries, so I’d imagine there is this type of 2D (i.e. the distribution is 2D) histogram somewhere in there, but it might take a lot of digging through documentation to find it.

One thing that occurs to me is that you can make something like this using surface in Makie. Of course, you’d need a separate histogram implementation to do that. There is one available in StatsBase.jl.

It doesn’t plot in 3D, but there’s histogram2d in StatsPlots.

using StatsPlots
x = randn(1000)
y = randn(1000)
histogram2d(x, y)

And while it isn’t quite the “Lego” effect, you can also fit a 2D histogram and plot it as a wireframe:

using StatsBase, Plots
h = fit(Histogram, (x, y), nbins=20)
plot(h) # same as histogram2d
wireframe(midpoints(h.edges[1]), midpoints(h.edges[2]), h.weights)

In case it wasn’t apparent, my suggestion was the same as @ElOceanografo’s, surface in Makie is just an alternative that gives basically the same thing (I think makie has wireframe as well).