# Add a vertical line to an AoG plot

**URL:** <https://discourse.julialang.org/t/add-a-vertical-line-to-an-aog-plot/91123>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [December 2, 2022, 3:34am UTC](https://discourse.julialang.org/t/add-a-vertical-line-to-an-aog-plot/91123 "2022-12-02T03:34:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [December 2, 2022, 3:34am UTC](https://discourse.julialang.org/t/add-a-vertical-line-to-an-aog-plot/91123/1 "2022-12-02T03:34:01Z")

</div>

In ggplot2, I can add a vertical line like this. How to do it in AoG?

```julia
ggplot(df, aes(x=x, y=y)) +
  geom_point() +
  geom_vline(xintercept=10)

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/b/1/b10c02c05e2c1e89cbe054a1fbde63f315d7872e.jpeg)

---

<div class="post-metadata">

**Author:** ![icweaver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/icweaver/32/45764_2.png) [@icweaver](https://discourse.julialang.org/u/icweaver)\
**Post date:** [December 2, 2022, 4:12am UTC](https://discourse.julialang.org/t/add-a-vertical-line-to-an-aog-plot/91123/2 "2022-12-02T04:12:33Z")

</div>

Would something like this work alright?

 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/0/e008e5c68c983fb75a7bc63a3e2146c8ce6c1ef3.png)

```julia
using AlgebraOfGraphics, CairoMakie, DataFrames

df = DataFrame(x=1:10, y=rand(10))

plt = data(df) * mapping(:x, :y) +
    mapping([5, 6, 7]) * visual(VLines; color=:blue, linestyle=:dash)

draw(plt)

```

---

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [December 2, 2022, 4:28am UTC](https://discourse.julialang.org/t/add-a-vertical-line-to-an-aog-plot/91123/3 "2022-12-02T04:28:34Z")

</div>

That looks good. What package/version is VLines in?

---

<div class="post-metadata">

**Author:** ![icweaver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/icweaver/32/45764_2.png) [@icweaver](https://discourse.julialang.org/u/icweaver)\
**Post date:** [December 2, 2022, 4:54am UTC](https://discourse.julialang.org/t/add-a-vertical-line-to-an-aog-plot/91123/4 "2022-12-02T04:54:01Z")

</div>

It’s a part of Makie. It (and others) were [turned into recipes a while back](https://github.com/MakieOrg/Makie.jl/pull/2023), so they can be called by the current release of AoG now I believe
