# Problem with changing color map inside plot recipe

**URL:** <https://discourse.julialang.org/t/problem-with-changing-color-map-inside-plot-recipe/7756>\
**Category:** Visualization\
**Tags:** question, plotting, plots, recipe\
**Created:** [December 14, 2017, 5:28am UTC](https://discourse.julialang.org/t/problem-with-changing-color-map-inside-plot-recipe/7756 "2017-12-14T05:28:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [December 14, 2017, 5:28am UTC](https://discourse.julialang.org/t/problem-with-changing-color-map-inside-plot-recipe/7756/1 "2017-12-14T05:28:21Z")

</div>

Consider the following plot recipe:

```julia
using RecipesBase

struct DummyType end

@recipe function f(dummy::DummyType)
    @series begin
        seriestype := :contourf
        color --> :bluesreds
        
        [i+j for i in 1:10, j in 1:10]
    end
end

```

It works fine as illustrated below:

```julia
using Plots; gr()

plot(DummyType())

```

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

However, if I try to set the default color map to something else like in

```julia
plot(DummyType(), color=:plasma)

```

the option doesn’t take effect, and I get back the same color map as before.

Could you please explain what is happening?

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [December 14, 2017, 2:52pm UTC](https://discourse.julialang.org/t/problem-with-changing-color-map-inside-plot-recipe/7756/2 "2017-12-14T14:52:41Z")

</div>

That’s because `color` isn’t the actual name of the attribute - the attribute is `seriescolor` and `color` is just a short alias for it. You should always use the full name of the attribute in a recipe (you can find that with `plotattr("color")`).

```julia
@recipe function f(dummy::DummyType)
    @series begin
        seriestype := :contourf
        seriescolor --> :bluesreds
        
        [i+j for i in 1:10, j in 1:10]
    end
end
plot(DummyType(), color=:plasma)

```

![16](https://global.discourse-cdn.com/julialang/original/3X/7/5/7557a72495fc45ebf1f504ecd95a4305693c3fcf.png)

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [December 14, 2017, 4:36pm UTC](https://discourse.julialang.org/t/problem-with-changing-color-map-inside-plot-recipe/7756/3 "2017-12-14T16:36:36Z")

</div>

Thank you @mkborregaard, on the spot. 👍 🙂 Also thanks for reminding me of `plotattr()`, I need to use it more in the future.
