# Second plot series send to background

**URL:** https://discourse.julialang.org/t/second-plot-series-send-to-background/45889
**Category:** New to Julia
**Tags:** plotting, plots
**Created:** [September 1, 2020, 12:13pm UTC](https://discourse.julialang.org/t/second-plot-series-send-to-background/45889 "2020-09-01T12:13:29Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![moesphere](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/moesphere/32/3348_2.png) [@moesphere](https://discourse.julialang.org/u/moesphere)
#### Post date: [September 1, 2020, 12:13pm UTC](https://discourse.julialang.org/t/second-plot-series-send-to-background/45889/1 "2020-09-01T12:13:29Z")

</div>

Is it possible to send a second plot (e.g. a vertical line) to the background? I know, if I drew the vertical line first, I would get what I want. However, then I have to provide axis scales in order to get a nice plot.

MWE:

```julia
using Plots
plot(rand(4))
vline!([2.])

```

---

<div class="post-metadata">

### Author: ![yha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yha/32/3502_2.png) [@yha](https://discourse.julialang.org/u/yha)
#### Post date: [September 1, 2020, 5:31pm UTC](https://discourse.julialang.org/t/second-plot-series-send-to-background/45889/2 "2020-09-01T17:31:30Z")

</div>

> [@moesphere](#):
>
> However, then I have to provide axis scales in order to get a nice plot.

I don’t have a solution, but I would say that this (the fact that the default axis limits depend on the series order) is a bug and you should file an issue with Plots.

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [September 1, 2020, 6:22pm UTC](https://discourse.julialang.org/t/second-plot-series-send-to-background/45889/3 "2020-09-01T18:22:47Z")

</div>

Why exactly providing axis scales is a problem? Maybe you could specify a little bit further the issue?

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [September 1, 2020, 7:01pm UTC](https://discourse.julialang.org/t/second-plot-series-send-to-background/45889/4 "2020-09-01T19:01:16Z")

</div>

One hacky way around would be to just plot whatever you want to plot second first with `alpha = 0.0, label = "")` to automatically get the axis limits, then `vline!()`, then `plot()` again

---

<div class="post-metadata">

### Author: ![moesphere](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/moesphere/32/3348_2.png) [@moesphere](https://discourse.julialang.org/u/moesphere)
#### Post date: [September 11, 2020, 12:45pm UTC](https://discourse.julialang.org/t/second-plot-series-send-to-background/45889/5 "2020-09-11T12:45:00Z")

</div>

Thanks for the hack! 🙂
