# Change colours in contour plot

**URL:** <https://discourse.julialang.org/t/change-colours-in-contour-plot/1953>\
**Category:** General Usage\
**Tags:** package, plotting\
**Created:** [February 7, 2017, 1:19pm UTC](https://discourse.julialang.org/t/change-colours-in-contour-plot/1953 "2017-02-07T13:19:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Holy\_Monk](https://avatars.discourse-cdn.com/v4/letter/h/c6cbf5/32.png) [@Holy\_Monk](https://discourse.julialang.org/u/Holy_Monk)\
**Post date:** [February 7, 2017, 1:19pm UTC](https://discourse.julialang.org/t/change-colours-in-contour-plot/1953/1 "2017-02-07T13:19:10Z")

</div>

I use the function contour (with fill = “true”) to make contour plots, for this I use Plots.jl. I would however like to change the colour scheme to gray-values, I found that you can do colormap(“Grays”) but this does not change my contour-plot gray. I would also like to adapt my scale (make the low values vary more in color than the high values, i.e. the difference between 0 and 0.084 should be the same as the colour difference between 0.084 and 0.48).

---

<div class="post-metadata">

**Author:** ![tbreloff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbreloff/32/68_2.png) [@tbreloff](https://discourse.julialang.org/u/tbreloff)\
**Post date:** [February 7, 2017, 2:11pm UTC](https://discourse.julialang.org/t/change-colours-in-contour-plot/1953/2 "2017-02-07T14:11:35Z")

</div>

Try something like this:

```julia
using Plots
x = y = linspace(-5,5,100)
contour(x, y, (x,y)->cos(x)+cos(y), fill=(true,cgrad(:grays,[0,0.1,1.0])))

```

![](https://global.discourse-cdn.com/julialang/original/3X/0/b/0b882d34d8c3d9c5148626d0bef26f7416a7517d.png)

---

<div class="post-metadata">

**Author:** ![Holy\_Monk](https://avatars.discourse-cdn.com/v4/letter/h/c6cbf5/32.png) [@Holy\_Monk](https://discourse.julialang.org/u/Holy_Monk)\
**Post date:** [February 7, 2017, 2:46pm UTC](https://discourse.julialang.org/t/change-colours-in-contour-plot/1953/3 "2017-02-07T14:46:10Z")

</div>

Perfect, this is exactly what I needed.  
Is there a place where I can find all options you can choose with contour? I didn’t find it in the documentation.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [February 7, 2017, 3:18pm UTC](https://discourse.julialang.org/t/change-colours-in-contour-plot/1953/4 "2017-02-07T15:18:17Z")

</div>

> [@Holy\_Monk](#):
>
> Is there a place where I can find all options you can choose with contour? I didn’t find it in the documentation.

[https://juliaplots.github.io/attributes/](https://juliaplots.github.io/attributes/)

---

<div class="post-metadata">

**Author:** ![Holy\_Monk](https://avatars.discourse-cdn.com/v4/letter/h/c6cbf5/32.png) [@Holy\_Monk](https://discourse.julialang.org/u/Holy_Monk)\
**Post date:** [February 14, 2017, 3:31pm UTC](https://discourse.julialang.org/t/change-colours-in-contour-plot/1953/5 "2017-02-14T15:31:55Z")

</div>

I still have a question about these colors:

I have 2 pictures I want to compare but the plotted values do not lie in the same range (i.e. one of them can have higher values than the other). How do I force the color scale of the lower one to go up to the maximum color value of the other one, i.e. adapt the range of the z-values?
