I have a dataset looks like(contains ~25 data-points):
x=[2.225 2.325 2.425 2.075 2.375 1.925 1.975 1.775 1.975 2.375]
y=[147.75 130.25 161.75 147.75 165.25 151.25 158.25 151.25 172.25 123.25]
z=[-1.36, -0.401, -0.741, -0.623, -0.44, -0.37, 0.120, 2.8, 0.026, -1.19]
I'm trying to plot a 3D-bar chart using the data.
I was trying like:
from mpl_toolkits.mplot3d import Axes3D
fig_3d_bar = plt.figure(figsize=(7, 5))
dx = fig_3d_bar.add_subplot(111, projection='3d')
x_pos = np.array(x)
y_pos = np.array(y)
z_pos = np.zeros(len(x))
dx = np.ones(len(x))
dy = np.ones(len(y))
dz = z
dx.bar3d(x_pos, y_pos, z_pos, dx, dy, dz, color='#00ceaa')
But this is giving me an error report as:
dx.bar3d(x_pos, y_pos, z_pos, dx, dy, dz, color='#00ceaa')
AttributeError: 'numpy.ndarray' object has no attribute 'bar3d'
A little help would serve great. Don't know what is going wrong.
thank you.