# Unable to make 3d quiver plot

**URL:** <https://discourse.julialang.org/t/unable-to-make-3d-quiver-plot/30811>\
**Category:** General Usage\
**Tags:** plotting, pyplot, makie, 3d\
**Created:** [November 6, 2019, 11:17pm UTC](https://discourse.julialang.org/t/unable-to-make-3d-quiver-plot/30811 "2019-11-06T23:17:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alacritas](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@alacritas](https://discourse.julialang.org/u/alacritas)\
**Post date:** [November 6, 2019, 11:17pm UTC](https://discourse.julialang.org/t/unable-to-make-3d-quiver-plot/30811/1 "2019-11-06T23:17:51Z")

</div>

I have 3 dimensional data, but it looks like the only available package to do this is PyPlot, but this available example is not working with my environment (Julia 1.2.0), and returns an error saying `Unkown projection '3d'`. [quote=“jw3126, post:3, topic:2117”]  
using PyPlot pygui(true) fig = figure() ax = fig:gca N = 10 x,y,z,u,v,w = [randn(N) for \_ in 1:6] ax[:quiver](x,y,z, u,v,w)  
[/quote]  
Are there any current examples that would create this plot with the current Julia and package versions?

---

<div class="post-metadata">

**Author:** ![Pbellive](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pbellive/32/3604_2.png) [@Pbellive](https://discourse.julialang.org/u/Pbellive)\
**Post date:** [November 7, 2019, 1:05am UTC](https://discourse.julialang.org/t/unable-to-make-3d-quiver-plot/30811/2 "2019-11-07T01:05:23Z")

</div>

This isn’t so much a julia issue as a PyPlot issue. If you run the Python equivalent of the code in your post you get the same error message. For example, to get a 3D axes object in Python you can do

```nohighlight
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

```

The equivalent code in julia (plus the bit to actually make the quiver plot) is the following:

```julia
using PyCall, PyPlot
mpl = pyimport("mpl_toolkits.mplot3d")
fig = figure()
ax = fig.add_subplot(111, projection="3d")
N = 10
x,y,z,u,v,w = [randn(N) for _ in 1:6]
ax.quiver(x,y,z, u,v,w)

```

Note the pyimport statement that loads the `mpl_toolkits.mplot3d` module. Also, the clunky `ax[:quiver]` syntax is no longer necessary. Thanks to some really cool work in PyCall.jl you can use the . syntax to access methods of Python objects from julia.

Edit: You mentioned PyPlot in your original post so I gave a PyPlot solution. I haven’t actually tried it but it seems that [Makie](http://makie.juliaplots.org/stable/) and possibly other plotting platforms in julia can do this. Here’s a related Makie example: [https://simondanisch.github.io/ReferenceImages/gallery/arrows\_3d/index.html](https://simondanisch.github.io/ReferenceImages/gallery/arrows_3d/index.html)
