-3

I have sequence of point with 3 coordinates each

How to plot them as polyline in 3D?

The following code

import matplotlib.pyplot as plt

x = [1, 2, 3]
y = [2, 3, 4]
z = [5, 6, 7]

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

ax.plot_wireframe(x, y, z)

plt.show()

throws

Unknown projection '3d'
Scott Hunter
  • 48,888
  • 12
  • 60
  • 101
Dims
  • 47,675
  • 117
  • 331
  • 600

1 Answers1

1

You're missing an import statement. Add from mpl_toolkits.mplot3d import Axes3D and you should be fine.

bendl
  • 1,583
  • 1
  • 18
  • 41