# How to plot matrix as gradient grid?

**URL:** <https://discourse.julialang.org/t/how-to-plot-matrix-as-gradient-grid/82187>\
**Category:** New to Julia\
**Tags:** makie, cairomakie-plotting\
**Created:** [June 3, 2022, 1:57pm UTC](https://discourse.julialang.org/t/how-to-plot-matrix-as-gradient-grid/82187 "2022-06-03T13:57:18Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![icweaver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/icweaver/32/45764_2.png) [@icweaver](https://discourse.julialang.org/u/icweaver)\
**Post date:** [June 9, 2022, 3:01pm UTC](https://discourse.julialang.org/t/how-to-plot-matrix-as-gradient-grid/82187/10 "2022-06-09T15:01:27Z")

</div>

I think this was addressed here [How to add grid lines on top of a heatmap in Makie? - #2 by jules](https://discourse.julialang.org/t/how-to-add-grid-lines-on-top-of-a-heatmap-in-makie/77578/2)

So basically just:

```julia
using CairoMakie

fig = Figure()
ax = Axis(fig[1, 1];
	xgridcolor = :white,
	xgridstyle = :dot,
	xgridwidth = 10,
	ygridcolor = :red,
	ygridwidth = 10,
)

hm = heatmap!(ax, rand(5, 5))

translate!(hm, 0, 0, -100)

fig

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/f/8/f861b6a3b6c8187666bde57feaefa34aedb0b42c.png)

A bunch more options can be found here [API](https://makie.juliaplots.org/v0.17.3/api/index.html#Axis)

---

_[View the full topic](https://discourse.julialang.org/t/how-to-plot-matrix-as-gradient-grid/82187)._
