# No heatmap interpolation in CairoMakie?

**URL:** <https://discourse.julialang.org/t/no-heatmap-interpolation-in-cairomakie/79662>\
**Category:** New to Julia\
**Tags:** plotting, makie\
**Created:** [April 18, 2022, 10:43pm UTC](https://discourse.julialang.org/t/no-heatmap-interpolation-in-cairomakie/79662 "2022-04-18T22:43:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![poopsilon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/poopsilon/32/35351_2.png) [@poopsilon](https://discourse.julialang.org/u/poopsilon)\
**Post date:** [April 18, 2022, 10:43pm UTC](https://discourse.julialang.org/t/no-heatmap-interpolation-in-cairomakie/79662/1 "2022-04-18T22:43:04Z")

</div>

I am trying to plot a heatmap with color interpolation, but I can’t seem to do it. I tried do it using the [example from the Makie website](https://makie.juliaplots.org/stable/examples/plotting_functions/heatmap/)

```julia
using CairoMakie

xs = range(0, 10, length = 25)
ys = range(0, 15, length = 25)
zs = [cos(x) * sin(y) for x in xs, y in ys]

heatmap(xs, ys, zs, interpolate=true)

```

but I get an identical plot as the example:

 ![plot_18](https://global.discourse-cdn.com/julialang/original/3X/a/4/a4ea79699ebc626a84f197519cbdb1d993166897.png)

What am I doing wrong? I’m using `CairoMakie v0.6.2`.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [April 19, 2022, 9:37am UTC](https://discourse.julialang.org/t/no-heatmap-interpolation-in-cairomakie/79662/2 "2022-04-19T09:37:31Z")

</div>

This seems to be a regression. To be honest, the filtering behavior of Cairo is a bit weird, you get inconsistent results between bitmap and vector backends. It seems that currently FILTER\_BEST is set for bitmap backends, but this doesn’t actually blur anything and looks like FILTER\_NEAREST (your example). FILTER\_BILINEAR seems to blur in both vector and bitmap backends. But FILTER\_NEAREST _does_ blur in vector backends. (That’s due to pdf/svg renderer implementations though). So I think the value should be reset to FILTER\_BILINEAR for interpolation.

---

<div class="post-metadata">

**Author:** ![Midez](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Midez](https://discourse.julialang.org/u/Midez)\
**Post date:** [February 2, 2024, 10:35pm UTC](https://discourse.julialang.org/t/no-heatmap-interpolation-in-cairomakie/79662/3 "2024-02-02T22:35:27Z")

</div>

How to do that actually? Where do you reset to FILTER\_BILINEAR ?

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [March 6, 2024, 2:49pm UTC](https://discourse.julialang.org/t/no-heatmap-interpolation-in-cairomakie/79662/4 "2024-03-06T14:49:26Z")

</div>

I think that’s only done in the Makie internals, but it should work by default now after [this fix](https://github.com/MakieOrg/Makie.jl/pull/1828). At least the code in the top post works for me know.
