GLMakie heatmap vs. heatmap!

In GLMakie I need a layout with several heatmaps. If I use heatmap works as expected (2D plot), however using heatmap! produces a 3D plot of the heatmap. Here is reproducer with a single heatmap.

using GLMakie
data = [ x * y  for x in 1:100, y in 1:100 ]
heatmap(data)

produces

but the following code

using GLMakie
data = [ x * y  for x in 1:100, y in 1:100 ]
fig = Figure()
scene = LScene(fig[1, 1])
heatmap!(scene, data)
display(fig)

produces

Any suggestion? Thanks.

LScene is a 3D axis (or to be more precise, a wrapper around Scene, that creates a 3d camera by default)…
See: LScene
The actual equivalent for heatmap! is:

using GLMakie
data = [ x * y  for x in 1:100, y in 1:100 ]
fig = Figure()
ax = Axis(fig[1, 1])
heatmap!(ax, data)
fig
1 Like