# Best library for visualizing 3d vectors

**URL:** https://discourse.julialang.org/t/best-library-for-visualizing-3d-vectors/62836
**Category:** New to Julia
**Tags:** plotting, makie, gaston
**Created:** [June 13, 2021, 2:21pm UTC](https://discourse.julialang.org/t/best-library-for-visualizing-3d-vectors/62836 "2021-06-13T14:21:29Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![peteole](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peteole/32/209790_2.png) [@peteole](https://discourse.julialang.org/u/peteole)
#### Post date: [June 13, 2021, 2:21pm UTC](https://discourse.julialang.org/t/best-library-for-visualizing-3d-vectors/62836/1 "2021-06-13T14:21:29Z")

</div>

Hi,  
I am an engineering student and have a lot of homework which include vector calculations (like computing positions, forces, angular momentums, rotation axis ect).  
It would be really great if I could make 3d visualizations of these vectors in an easy way (just specify the vector and optionally a starting point), maybe even integrated into a notebook. The greatest thing would be if one could interactively rotate and pan/zoom the rendering, but this is optional.  
What’s the best way to do this in julia?

---

<div class="post-metadata">

### Author: ![mbaz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbaz/32/17295_2.png) [@mbaz](https://discourse.julialang.org/u/mbaz)
#### Post date: [June 13, 2021, 3:59pm UTC](https://discourse.julialang.org/t/best-library-for-visualizing-3d-vectors/62836/2 "2021-06-13T15:59:45Z")

</div>

Here’s a quick example using Gaston.jl and Pluto. You will have to install gnuplot on your own. (Sorry about the gray color, something’s wrong with my screen recorder):

![Peek 2021-06-13 11-54](https://global.discourse-cdn.com/julialang/original/3X/8/3/833d94a96b711a764b1e5c14d5f4c7ad262b2bb9.gif)

```julia
### A Pluto.jl notebook ###
# v0.14.7

using Markdown
using InteractiveUtils

# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
    quote
        local el = $(esc(element))
        global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : missing
        el
    end
end

# ╔═╡ 8168dcd0-cc5c-11eb-03e9-2793002c4e32
using Gaston

# ╔═╡ 1ef29674-c85e-436e-a6fc-487fceb41f94
using PlutoUI

# ╔═╡ 8e8feefc-702f-4f6e-956c-1afd445d4592
@bind rot Slider(0:360, default=60, show_value=true)

# ╔═╡ c1b7875a-018e-4902-93af-aa088e58b153
@bind x Slider(-10:10, default=0, show_value=true)

# ╔═╡ c3ee83f5-fcae-4a2e-90dd-7e3199519ab9
@bind y Slider(-10:10, default=0, show_value=true)

# ╔═╡ 89882c0c-f86d-44d9-866d-df828afce0d0
@bind z Slider(-10:10, default=0, show_value=true)

# ╔═╡ 6f2041b3-ba57-4008-84e3-4a7e3dcced52
plot([0], [0], [0], supp=[x y z], Axes(xr="[-10:10]",yr="[-10:10]",zr="[-10:10]",view="60, $rot",xl=:x,yl=:y,zl=:z,xzeroaxis=true,yzeroaxis=true,zzeroaxis=true,xyplane="at -10"),with="vectors",dims=3)

# ╔═╡ Cell order:
# ╠═8168dcd0-cc5c-11eb-03e9-2793002c4e32
# ╠═1ef29674-c85e-436e-a6fc-487fceb41f94
# ╠═8e8feefc-702f-4f6e-956c-1afd445d4592
# ╠═c1b7875a-018e-4902-93af-aa088e58b153
# ╠═c3ee83f5-fcae-4a2e-90dd-7e3199519ab9
# ╠═89882c0c-f86d-44d9-866d-df828afce0d0
# ╠═6f2041b3-ba57-4008-84e3-4a7e3dcced52

```

---

<div class="post-metadata">

### Author: ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)
#### Post date: [June 13, 2021, 5:50pm UTC](https://discourse.julialang.org/t/best-library-for-visualizing-3d-vectors/62836/3 "2021-06-13T17:50:50Z")

</div>

Makie.jl is a great option for this.
