# Makie - How to set custom x and y tick values in a Makie heatmap

**URL:** https://discourse.julialang.org/t/makie-how-to-set-custom-x-and-y-tick-values-in-a-makie-heatmap/81397
**Category:** Visualization
**Tags:** makie
**Created:** [May 20, 2022, 9:58pm UTC](https://discourse.julialang.org/t/makie-how-to-set-custom-x-and-y-tick-values-in-a-makie-heatmap/81397 "2022-05-20T21:58:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Brinkhuis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brinkhuis/32/18752_2.png) [@Brinkhuis](https://discourse.julialang.org/u/Brinkhuis)
#### Post date: [May 20, 2022, 9:58pm UTC](https://discourse.julialang.org/t/makie-how-to-set-custom-x-and-y-tick-values-in-a-makie-heatmap/81397/1 "2022-05-20T21:58:49Z")

</div>

I want to make a heatmap in Julia using Makie (CairoMakie) with custom `x` and `y` tick values on the axes, like [this](https://seaborn.pydata.org/examples/spreadsheet_heatmap.html) one from Seaborn.

Any suggestions on how to modify the figure to het the months `January` to `December` on the Y-axis and the years `1949` to `1960` on the X-axis.

My code so far:

```
using DataFrames
using CSV
using CairoMakie

download("https://raw.githubusercontent.com/mwaskom/seaborn-data/master/flights.csv", "flights.csv")
flights = DataFrame(CSV.File("flights.csv"))

data = Array(unstack(flights, :year, :month, :passengers)[!, 2:end])

fig = Figure()
ax = Axis(fig[1, 1], xlabel = "Year", ylabel = "Month")
hm = heatmap!(ax, data)

Colorbar(fig[1, 2], hm)

text!(ax,
    string.(data'),
    position = [Point2f(x, y) for x in 1:12 for y in 1:12],
    align = (:center, :center),
    color = ifelse.(data' .< 400, :white, :black),
    textsize = 14,
    )

save("figure.png", fig)

fig

```

[![enter image description here](https://global.discourse-cdn.com/julialang/original/3X/1/d/1dd932bc95d85c04fdb5af2f3df58b68174daca9.png)](https://i.stack.imgur.com/zbGSb.png)

---

<div class="post-metadata">

### Author: ![Salmon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/salmon/32/22968_2.png) [@Salmon](https://discourse.julialang.org/u/Salmon)
#### Post date: [May 20, 2022, 10:22pm UTC](https://discourse.julialang.org/t/makie-how-to-set-custom-x-and-y-tick-values-in-a-makie-heatmap/81397/2 "2022-05-20T22:22:25Z")

</div>

You should be able to use the `xticks` and `yticks` arguments. Check out this Makie gallery, it also has the example you are looking for:  
[https://lazarusa.github.io/BeautifulMakie/heatmaps/heatmapText/](https://lazarusa.github.io/BeautifulMakie/heatmaps/heatmapText/)

---

<div class="post-metadata">

### Author: ![hamblingreg52](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hamblingreg52/32/23956_2.png) [@hamblingreg52](https://discourse.julialang.org/u/hamblingreg52)
#### Post date: [May 21, 2022, 7:06am UTC](https://discourse.julialang.org/t/makie-how-to-set-custom-x-and-y-tick-values-in-a-makie-heatmap/81397/3 "2022-05-21T07:06:30Z")

</div>

Thanks, @Salmon. Getting the example has also helped me.
