# Easy way to plot a circle given as a vector of vectors (pointwise) as line plot?

**URL:** <https://discourse.julialang.org/t/easy-way-to-plot-a-circle-given-as-a-vector-of-vectors-pointwise-as-line-plot/104574>\
**Category:** Visualization\
**Tags:** question, plotting, plots, plot, stack\
**Created:** [October 4, 2023, 1:39pm UTC](https://discourse.julialang.org/t/easy-way-to-plot-a-circle-given-as-a-vector-of-vectors-pointwise-as-line-plot/104574 "2023-10-04T13:39:02Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![homocomputeris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/homocomputeris/32/8933_2.png) [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Post date:** [October 4, 2023, 1:39pm UTC](https://discourse.julialang.org/t/easy-way-to-plot-a-circle-given-as-a-vector-of-vectors-pointwise-as-line-plot/104574/1 "2023-10-04T13:39:02Z")

</div>

Is there an easier way to plot a shape (in geometric sense, not `Plots.jl`’s) given as a vector of points (i.e. 2D-vectors)?

```julia
using Plots

# approximately a circle
vector_of_points = [[0.708441362115303, 1.413585198669223],
    [1.0185589103132255, 1.557842996204574],
    [1.3488474334102414, 1.4690134256250358],
    [1.5447662714075574, 1.188657163943744],
    [1.5146337337537332, 0.8479675075866541],
    [1.2725600518547597, 0.6063407865330036],
    [0.9318084528866316, 0.5768437043492579],
    [0.6518197911665652, 0.7732820990802726],
    [0.5636046347857182, 1.1037378826491369],
    [0.7084413621153031, 1.4135851986692225]]

# convert to matrix
matrix_of_point = stack(vector_of_points)

# disassemble the matrix to arguments and values
x = matrix_of_point[1, :]
y = matrix_of_point[2, :]

# almost a circle
plot(x, y)

```

---

_[View the full topic](https://discourse.julialang.org/t/easy-way-to-plot-a-circle-given-as-a-vector-of-vectors-pointwise-as-line-plot/104574)._
