Matplotlib - 3D Plotting
Why does this code raise an error?
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D fig = plt.figure() ax = fig.add_subplot(111, projection='3d') X, Y = np.meshgrid(np.linspace(-1, 1, 10), np.linspace(-1, 1, 10)) Z = np.sin(X) + np.cos(Y) ax.plot_wireframe(X, Y) plt.show()
