Add reference lines to plot in VegaLite.jl

amrods
Thu, 05 May 2022 00:46:21 +0000
Visualization

I’m trying to add 2 reference horizontal lines to this plot, but my attempt doesn’t extend the lines to the y-axis, which is what I want. Any suggestions?

using DataFrames
using VegaLite

df = DataFrame(m = 1:5, ll=21:25, ul=:31:35)

df |> @vlplot(x=:m, height=400, width=400) +
  @vlplot(:point, y=:ul) +
  @vlplot(:point, y=:ll) +
  @vlplot(mark={:line, color=:red}, y={datum=26}) +
  @vlplot(mark={:line, color=:black}, y={datum=0}) +
  @vlplot(:rule, y=:ul, y2=:ll)

3 posts - 1 participant