When executing this line of code:
import matplotlib.pyplot as plt
#your code
fig = plt.figure()
ax = fig.gca(projection='3d')
I have an output error:
raise ValueError("Unknown projection %r" % projection)
ValueError: Unknown projection '3d'
<Figure size 432x288 with 0 Axes>
The error appears also when I use Spyder as IDE.
The version of matplotlib
is
print('matplotlib: {}'.format(matplotlib.__version__))
matplotlib: 1.5.0rc3
But I had the same problem even with other versions of matplotlib
.
A similar error was reported in this question (Stackoverflow) but the answers do not help. Some suggestions on how to modify the instruction?
matplotlib: 3.0.2