# GLMakie heatmap vs. heatmap!

**URL:** <https://discourse.julialang.org/t/glmakie-heatmap-vs-heatmap/75378>\
**Category:** Visualization\
**Tags:** glmakie\
**Created:** [January 28, 2022, 4:15pm UTC](https://discourse.julialang.org/t/glmakie-heatmap-vs-heatmap/75378 "2022-01-28T16:15:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![peremato](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peremato/32/29128_2.png) [@peremato](https://discourse.julialang.org/u/peremato)\
**Post date:** [January 28, 2022, 4:15pm UTC](https://discourse.julialang.org/t/glmakie-heatmap-vs-heatmap/75378/1 "2022-01-28T16:15:28Z")

</div>

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.

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

```

produces

 ![Screen Shot 2022-01-28 at 17.12.20](https://global.discourse-cdn.com/julialang/original/3X/c/0/c0f90aeb9ab2f2b4d102b477417218a24efb0153.png)

but the following code

```julia
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

 ![Screen Shot 2022-01-28 at 17.02.09](https://global.discourse-cdn.com/julialang/original/3X/d/5/d58a8178c57a1afc10d72ebaac31e7635fea276a.png)

Any suggestion? Thanks.

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [January 28, 2022, 4:50pm UTC](https://discourse.julialang.org/t/glmakie-heatmap-vs-heatmap/75378/2 "2022-01-28T16:50:25Z")

</div>

LScene is a 3D axis (or to be more precise, a wrapper around `Scene`, that creates a 3d camera by default)…  
See: [https://makie.juliaplots.org/stable/examples/layoutables/lscene/index.html](https://makie.juliaplots.org/stable/examples/layoutables/lscene/index.html)  
The actual equivalent for heatmap! is:

```julia
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

```
