# GRUtils: error bars always behind fill in bar plot

**URL:** <https://discourse.julialang.org/t/grutils-error-bars-always-behind-fill-in-bar-plot/75388>\
**Category:** Visualization\
**Tags:** plotting, gr\
**Created:** [January 28, 2022, 8:26pm UTC](https://discourse.julialang.org/t/grutils-error-bars-always-behind-fill-in-bar-plot/75388 "2022-01-28T20:26:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkschleg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkschleg/32/8035_2.png) [@mkschleg](https://discourse.julialang.org/u/mkschleg)\
**Post date:** [January 28, 2022, 8:26pm UTC](https://discourse.julialang.org/t/grutils-error-bars-always-behind-fill-in-bar-plot/75388/1 "2022-01-28T20:26:39Z")

</div>

I’m trying to combine the errorbar and barplot plots using hold. No matter what order I do this in the error bars always appear under the bar plot fill. Is there any fix for this?

MWE:

```plaintext
using GRUtils
let
	y = rand(10)
	barplot(string.(1:10).*"a", y)
	GRUtils.hold(true)
	f = errorbar(1:10, y, rand(10), "-o")
	GRUtils.hold(false)
	title("ExamplePlot")
end

```

With a graph that looks like:

 ![Screen Shot 2022-01-28 at 1.06.07 PM](https://global.discourse-cdn.com/julialang/original/3X/0/4/0415afa2421284a62710a26b04caa80808db7916.png)

I’m trying to get the error bars ontop of the fill, any ideas?

---

<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:** [January 29, 2022, 12:23am UTC](https://discourse.julialang.org/t/grutils-error-bars-always-behind-fill-in-bar-plot/75388/2 "2022-01-29T00:23:44Z")

</div>

Is it underneath or is it the same color?

Try using different colors:

```julia
using GRUtils
y = rand(10)
h = UInt(1)
barplot(string.(1:10).*"a", y, color=0x0000FF)
GRUtils.hold(true)
errorbar(1:10, y, rand(10), "-o", linecolor=0xFF0000)
GRUtils.hold(false)
title("ExamplePlot")

```

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

---

<div class="post-metadata">

**Author:** ![mkschleg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkschleg/32/8035_2.png) [@mkschleg](https://discourse.julialang.org/u/mkschleg)\
**Post date:** [January 29, 2022, 12:48am UTC](https://discourse.julialang.org/t/grutils-error-bars-always-behind-fill-in-bar-plot/75388/3 "2022-01-29T00:48:51Z")

</div>

🤦‍♂️ My brain must have seen them as black for some reason. Thanks!
