import numpy as np
from matplotlib import pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
X = np.empty([10,150])
Y = np.empty([10,150])
Z = np.empty([10,150])
plt.style.use('seaborn-v0_8-poster')
fig = plt.figure(figsize=(12, 12))
ax = plt.axes(projection='3d')
ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)
ax.set_xlabel('X Label', fontsize=14, fontweight='bold', labelpad=20)
ax.set_ylabel('Y Label', fontsize=14, fontweight='bold', labelpad=20)
ax.set_zlabel('Z Label', fontsize=14, fontweight='bold', labelpad=20)
colors = ['blue', 'cyan', 'turquoise', 'green', 'yellow', 'orange', 'red', 'crimson', 'magenta', 'purple', 'violet']
cmap = LinearSegmentedColormap.from_list('my_colormap', list(zip([np.linspace(0, 1, 11)], colors)))
plt.imshow([Z], cmap=cmap, vmin=0, vmax=1, interpolation='nearest')
plt.colorbar()
plt.show()
ValueError: ‘data’ must be 2D with shape (N, 3), but your input has shape (1, 13)
I have data in X, Y, Z variables. I m looking for plotting some fancy plots like this .
I m getting error ‘ValueError: ‘data’ must be 2D with shape (N, 3), but your input has shape (1, 13)’.
Can someone please guide me.