# Using Makie for contour plot with only one edge

**URL:** https://discourse.julialang.org/t/using-makie-for-contour-plot-with-only-one-edge/79603
**Category:** Visualization
**Tags:** plotting, makie
**Created:** [April 17, 2022, 4:02pm UTC](https://discourse.julialang.org/t/using-makie-for-contour-plot-with-only-one-edge/79603 "2022-04-17T16:02:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Sciemon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sciemon/32/20897_2.png) [@Sciemon](https://discourse.julialang.org/u/Sciemon)
#### Post date: [April 17, 2022, 4:02pm UTC](https://discourse.julialang.org/t/using-makie-for-contour-plot-with-only-one-edge/79603/1 "2022-04-17T16:02:03Z")

</div>

I want a 2D contour plot which shows the boundary where “matrix” becomes larger than zero. I do:  
CairoMakie.contour(matrix,levels = [0.0])  
The last step to make me happy would be to set the color of the boundary line. Right now it uses the colormap somehow, but I would like to exactly set the color of this line. Any suggestions?

---

<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 17, 2022, 4:24pm UTC](https://discourse.julialang.org/t/using-makie-for-contour-plot-with-only-one-edge/79603/2 "2022-04-17T16:24:16Z")

</div>

Hm maybe try setting a one color colormap? Like `colormap = [:red]`.

---

<div class="post-metadata">

### Author: ![Sciemon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sciemon/32/20897_2.png) [@Sciemon](https://discourse.julialang.org/u/Sciemon)
#### Post date: [April 17, 2022, 4:27pm UTC](https://discourse.julialang.org/t/using-makie-for-contour-plot-with-only-one-edge/79603/3 "2022-04-17T16:27:39Z")

</div>

Exactly what I was looking for! Couldn’t figure that one can define a colormap with only one color 😀 But it works! Thanks!!

---

<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 17, 2022, 4:30pm UTC](https://discourse.julialang.org/t/using-makie-for-contour-plot-with-only-one-edge/79603/4 "2022-04-17T16:30:39Z")

</div>

This is a bit of an edge case as contour is assumed to usually have multiple levels, so it doesn’t even offer the `color` keyword to override with a static color. Hence the one color colormap hack.
