# Plotting Unit Vectors

**URL:** <https://discourse.julialang.org/t/plotting-unit-vectors/37740>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [April 17, 2020, 6:33am UTC](https://discourse.julialang.org/t/plotting-unit-vectors/37740 "2020-04-17T06:33:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ennvvy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ennvvy/32/7816_2.png) [@ennvvy](https://discourse.julialang.org/u/ennvvy)\
**Post date:** [April 17, 2020, 6:33am UTC](https://discourse.julialang.org/t/plotting-unit-vectors/37740/1 "2020-04-17T06:33:39Z")

</div>

I want to plot unit vectors whose orientation varies from [-pi, pi]. A reference figure is below.  
 ![Screenshot 2020-04-17 at 12.00.11 PM](https://global.discourse-cdn.com/julialang/original/3X/7/0/708a47e25422812cd974f0cdb3d0c957de271b68.png)

Any suggestions on how I can get the desired plot?

---

<div class="post-metadata">

**Author:** ![mforets](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mforets/32/298_2.png) [@mforets](https://discourse.julialang.org/u/mforets)\
**Post date:** [April 17, 2020, 12:26pm UTC](https://discourse.julialang.org/t/plotting-unit-vectors/37740/2 "2020-04-17T12:26:34Z")

</div>

```julia
using LazySets, Plots

plot(map(p -> LineSegment(zeros(2), p), PolarDirections(16)), lw=2.,
     arrow=:true, markershape=:none, seriestype=:path)
plot!(Ball2(zeros(2), 1.0), alpha=.1, ratio=1.)

```

 ![Screenshot from 2020-04-17 09-23-05](https://global.discourse-cdn.com/julialang/original/3X/5/7/57400a94e17ecac589db5a4c4f439a1eb4455fa8.png)

Of course, you may want to use `Plots` directly; all the keyword arguments used above apply.
