# Scatter plot multiple series that don't share the same x values (Plots.jl)

**URL:** <https://discourse.julialang.org/t/scatter-plot-multiple-series-that-dont-share-the-same-x-values-plots-jl/79419>\
**Category:** New to Julia\
**Tags:** question, plots\
**Created:** [April 13, 2022, 7:41am UTC](https://discourse.julialang.org/t/scatter-plot-multiple-series-that-dont-share-the-same-x-values-plots-jl/79419 "2022-04-13T07:41:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmed](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@ahmed](https://discourse.julialang.org/u/ahmed)\
**Post date:** [April 13, 2022, 7:41am UTC](https://discourse.julialang.org/t/scatter-plot-multiple-series-that-dont-share-the-same-x-values-plots-jl/79419/1 "2022-04-13T07:41:40Z")

</div>

I have three series of data that I would like to show on a scatter plot. Let’s say (x1,y1), (x2,y2) and (x3,y3). x’s and y’s are arrays that do not have the same size. How can I make a plot that shows them together?  
I tried scatter(hcat(x1,x2,x3),hcat(y1,y2,y3)) but it doesn’t work because the arrays don’t have the same dimension.

---

<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:** [April 13, 2022, 8:58am UTC](https://discourse.julialang.org/t/scatter-plot-multiple-series-that-dont-share-the-same-x-values-plots-jl/79419/2 "2022-04-13T08:58:38Z")

</div>

```julia
scatter(x1, y1)
scatter!(x2, y2)
scatter!(x3, y3)

```

the `!` in the end of the two last commands indicates that you want to _add_ to the current plot.

---

<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:** [April 13, 2022, 9:09am UTC](https://discourse.julialang.org/t/scatter-plot-multiple-series-that-dont-share-the-same-x-values-plots-jl/79419/3 "2022-04-13T09:09:15Z")

</div>

You could also one-line it by grouping the data as vector of vectors:

```julia
scatter([x1,x2,x3], [y1,y2,y3])

```
