# 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:** 1\
**Showing post:** 2

<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)

---

_[View the full topic](https://discourse.julialang.org/t/unable-to-make-3d-quiver-plot/30811)._
