# How to set line color in errorline

**URL:** https://discourse.julialang.org/t/how-to-set-line-color-in-errorline/129522
**Category:** Visualization
**Tags:** statsplots
**Created:** [June 1, 2025, 12:58pm UTC](https://discourse.julialang.org/t/how-to-set-line-color-in-errorline/129522 "2025-06-01T12:58:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![PanT12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pant12/32/214053_2.png) [@PanT12](https://discourse.julialang.org/u/PanT12)
#### Post date: [June 1, 2025, 12:58pm UTC](https://discourse.julialang.org/t/how-to-set-line-color-in-errorline/129522/1 "2025-06-01T12:58:06Z")

</div>

Hi everyone,

I’m trying to set the line color in the `errorline` function from the `StatsPlots` package. However, I’ve noticed that I can only change the marker color and not the line color. Does anyone know how to set the line color in the `errorline` function?

Thank you!

```julia
x = 1:10
y = fill(NaN, 10, 100, 3)
for i = axes(y,3)
    y[:, :, i] = collect(1:2:20) .+ rand(10,100).*5 .* collect(1:2:20) .+ rand()*100
end

errorline(x, y[:, :, 1], errorstyle=:ribbon, label="Ribbon")
errorline!(x, y[:, :, 2], errorstyle=:stick, label="Stick", secondarycolor=:matched)
errorline!(x, y[:, :, 3], errorstyle=:plume, label="Plume")

```

---

<div class="post-metadata">

### Author: ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)
#### Post date: [June 2, 2025, 12:21pm UTC](https://discourse.julialang.org/t/how-to-set-line-color-in-errorline/129522/2 "2025-06-02T12:21:55Z")

</div>

Hi, have you tried using the `groupcolor` keyword argument?  
For example:

```julia
errorline(x, 2*y[:, :, 1], errorstyle=:ribbon, label="Ribbon", groupcolor=:red, secondarycolor=:pink)
errorline!(x, 1.3*y[:, :, 2], errorstyle=:stick, label="Stick", groupcolor=:blue, secondarycolor=:cyan)
errorline!(x, y[:, :, 3], errorstyle=:plume, label="Plume", groupcolor=:green, secondarycolor=:lime)

```

---

<div class="post-metadata">

### Author: ![PanT12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pant12/32/214053_2.png) [@PanT12](https://discourse.julialang.org/u/PanT12)
#### Post date: [June 2, 2025, 3:02pm UTC](https://discourse.julialang.org/t/how-to-set-line-color-in-errorline/129522/3 "2025-06-02T15:02:13Z")

</div>

Thanks for your help! It works now!
