# How to plot the orientation of particles?

**URL:** <https://discourse.julialang.org/t/how-to-plot-the-orientation-of-particles/94262>\
**Category:** Visualization\
**Tags:** question, plotting, plots\
**Created:** [February 8, 2023, 9:07am UTC](https://discourse.julialang.org/t/how-to-plot-the-orientation-of-particles/94262 "2023-02-08T09:07:32Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Sevi](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@Sevi](https://discourse.julialang.org/u/Sevi)\
**Post date:** [February 8, 2023, 9:46am UTC](https://discourse.julialang.org/t/how-to-plot-the-orientation-of-particles/94262/3 "2023-02-08T09:46:47Z")

</div>

It is also common to plot the orientation not with arrows (that can get messy quickly), but instead color the particles in different colors, according to their orientation, e.g. in this paper  
[https://www.researchgate.net/figure/Simulation-snapshot-of-active-Brownian-particles-in-an-elongated-box-employing-periodic\_fig1\_337966798](https://www.researchgate.net/figure/Simulation-snapshot-of-active-Brownian-particles-in-an-elongated-box-employing-periodic_fig1_337966798)

Here is another thread discussing how to achieve that: [How to color points in scatter plot by value?](https://discourse.julialang.org/t/how-to-color-points-in-scatter-plot-by-value/11740)

It boils down to something like

```julia
julia> using Plots
julia> N = 100
julia> xs = rand(N); ys = rand(N); φs = 2π .* rand(N);
julia> scatter(xs, ys, marker_z=φs, color=:rainbow)

```

---

_[View the full topic](https://discourse.julialang.org/t/how-to-plot-the-orientation-of-particles/94262)._
