# Plots.jl: Plotting a graph such that it has multiple possible values corresponding to a single x value

**URL:** <https://discourse.julialang.org/t/plots-jl-plotting-a-graph-such-that-it-has-multiple-possible-values-corresponding-to-a-single-x-value/122408>\
**Category:** Visualization\
**Tags:** plotting\
**Created:** [November 8, 2024, 7:58am UTC](https://discourse.julialang.org/t/plots-jl-plotting-a-graph-such-that-it-has-multiple-possible-values-corresponding-to-a-single-x-value/122408 "2024-11-08T07:58:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![GiovanniPaiela](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giovannipaiela/32/211934_2.png) [@GiovanniPaiela](https://discourse.julialang.org/u/GiovanniPaiela)\
**Post date:** [November 8, 2024, 7:58am UTC](https://discourse.julialang.org/t/plots-jl-plotting-a-graph-such-that-it-has-multiple-possible-values-corresponding-to-a-single-x-value/122408/1 "2024-11-08T07:58:52Z")

</div>

Say that I have an x and y dimensions. The value of y however, can have 2 possible values for a single x. How would one go about plotting such thing?  
So far I have tried defining y as an array of 2-element tuples and plotting it using Plots.jl but with no success.

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [November 8, 2024, 9:21am UTC](https://discourse.julialang.org/t/plots-jl-plotting-a-graph-such-that-it-has-multiple-possible-values-corresponding-to-a-single-x-value/122408/2 "2024-11-08T09:21:58Z")

</div>

Pass two vectors, one with x values and one with corresponding y values, some elements in the x vector will be repeated several times, which is fine. Use `scatter` instead of `plot` if you want points instead of lines.
