# Set the same colour for every \`@series\` in a loop of a plot recipe

**URL:** <https://discourse.julialang.org/t/set-the-same-colour-for-every-series-in-a-loop-of-a-plot-recipe/105117>\
**Category:** General Usage\
**Tags:** plots, recipe\
**Created:** [October 18, 2023, 12:16pm UTC](https://discourse.julialang.org/t/set-the-same-colour-for-every-series-in-a-loop-of-a-plot-recipe/105117 "2023-10-18T12:16:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![giancarloantonucci](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giancarloantonucci/32/202551_2.png) [@giancarloantonucci](https://discourse.julialang.org/u/giancarloantonucci)\
**Post date:** [October 18, 2023, 12:16pm UTC](https://discourse.julialang.org/t/set-the-same-colour-for-every-series-in-a-loop-of-a-plot-recipe/105117/1 "2023-10-18T12:16:36Z")

</div>

Take the following dummy plot-recipe:

```julia
using Plots

struct Example end

@recipe function f(ex::Example)
    @series begin
        seriescolor --> 1
        [1:10, 1:10]
    end
    for n in 1:10
        @series begin
            seriestype --> :scatter
            seriescolor --> 2
            [n], [n+1]
        end
    end
end

ex = Example()

plot(ex)

```

Is there a way to assign the same `seriescolor` to all the `@series` elements within the loop, without me specifying the colour `2` in `seriescolor --> 2`? Keep in mind that this is just a MWE: in my real problem, I must retain the loop structure.
