# Vline! with subplots

**URL:** <https://discourse.julialang.org/t/vline-with-subplots/25479>\
**Category:** General Usage\
**Created:** [June 20, 2019, 11:21am UTC](https://discourse.julialang.org/t/vline-with-subplots/25479 "2019-06-20T11:21:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [June 20, 2019, 11:21am UTC](https://discourse.julialang.org/t/vline-with-subplots/25479/1 "2019-06-20T11:21:53Z")

</div>

Hi-

When I try to add vertical lines to subplots, the lines only apply to the first subplot. Is there a way to add vertical lines to each subplot? Here is a MWE:

```julia
using DataFrames,StatsPlots

df = DataFrame(g=rand(1:3,100),y=randn(100))
@df df histogram(:y,group=:g,layout=(3,1))
vline!([0,0,0],layout=(3,1))

```

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [July 14, 2019, 3:19pm UTC](https://discourse.julialang.org/t/vline-with-subplots/25479/2 "2019-07-14T15:19:47Z")

</div>

I want to bump this up to see if anyone knows whether there is a solution or this is a bug.

---

<div class="post-metadata">

**Author:** ![daschw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/daschw/32/2926_2.png) [@daschw](https://discourse.julialang.org/u/daschw)\
**Post date:** [July 15, 2019, 10:10am UTC](https://discourse.julialang.org/t/vline-with-subplots/25479/3 "2019-07-15T10:10:58Z")

</div>

Sorry, you did not get an answer for so long.  
As I wrote in the StatsPlots issue you opened, you have to replace your last line with:

```julia
vline!([0 0 0])

```

With `[0 0 0]` being a row vector, each column corresponds to a series and each series is allocated to a subplot.

For future plotting questions I recommend asking in the Visualization domain [Visualization - JuliaLang](https://discourse.julialang.org/c/domain/viz), at the Plots.jl Gitter channel [tbreloff/Plots.jl - Gitter](https://gitter.im/tbreloff/Plots.jl) or in the plotting / plots-bridged channels in julias slack [http://julialang.slack.com](http://julialang.slack.com).
