# Finite hlines in Plot? Plots.jl

**URL:** <https://discourse.julialang.org/t/finite-hlines-in-plot-plots-jl/103189>\
**Category:** General Usage\
**Tags:** question, plots\
**Created:** [August 25, 2023, 1:31pm UTC](https://discourse.julialang.org/t/finite-hlines-in-plot-plots-jl/103189 "2023-08-25T13:31:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abehersan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abehersan/32/47221_2.png) [@abehersan](https://discourse.julialang.org/u/abehersan)\
**Post date:** [August 25, 2023, 1:31pm UTC](https://discourse.julialang.org/t/finite-hlines-in-plot-plots-jl/103189/1 "2023-08-25T13:31:35Z")

</div>

Is there a function similar to `hline!` but defined only over a finite x-range? I.e. something like:

```julia
hline!([3], [-1, 0])

```

Where a line would be plotted at `y=3` from `x=-1` to `x=0`.

I am aware this can be done simply by plotting a range at fixed `y`. I just wonder if such a function already exists since `hline!` exists.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [August 25, 2023, 9:19pm UTC](https://discourse.julialang.org/t/finite-hlines-in-plot-plots-jl/103189/2 "2023-08-25T21:19:03Z")

</div>

I don’t think there is such function, but you could build your own from:  
`plot!([-1,0], [3,3])`
