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)
I managed to force the reference lines with
df |> @vlplot(x=:m, height=400, width=400) +
@vlplot(:point, y=:ul) +
@vlplot(:point, y=:ll) +
@vlplot(mark={:line, color=:red}, y={datum=26}, x=[i for i in 0:0.1:5]) +
@vlplot(mark={:line, color=:black}, y={datum=0}, x=[i for i in 0:0.1:5]) +
@vlplot(:rule, y=:ul, y2=:ll)
But now the title of the x-axis disappears.
Just did this:
df |> @vlplot(x=:m, height=400, width=400) +
@vlplot(mark={:point, filled=true, color=:blue}, y=:ul) +
@vlplot(mark={:point, filled=true, color=:blue}, y=:ll) +
@vlplot(mark={:line, color=:red}, y={datum=26}, x={[i for i in 0.0:0.1:5], title="M"}) +
@vlplot(mark={:line, color=:black}, y={datum=0}, x={[i for i in 0.0:0.1:5], title="M"}) +
@vlplot(mark={:rule, color=:blue}, y=:ul, y2=:ll)