matplotlib - How to fill mplot3d bar plot depth? [Python 3.x] -
there example how build bar plot @ bottom of question taken matplotlib site.
i cannot find parameter increase depth of each bar. want depth give 3d this picture.
is there function parameter change i'm not seeing, or need use different 3d bar plot function?
below bar plot code first link in case can't see it:
from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot plt import numpy np fig = plt.figure() ax = fig.add_subplot(111, projection='3d') c, z in zip(['r', 'g', 'b', 'y'], [30, 20, 10, 0]): xs = np.arange(20) ys = np.random.rand(20) # can provide either single color or array. demonstrate this, # first bar of each set colored cyan. cs = [c] * len(xs) cs[0] = 'c' ax.bar(xs, ys, zs=z, zdir='y', color=cs, alpha=0.8) ax.set_xlabel('x') ax.set_ylabel('y') ax.set_zlabel('z') plt.show() i've found this link solution solution doesn't increase depth. i'm hoping method fill depth if possible.
do want code in this answer? use bar3d(), locations each bar manually created meshgrid.
Comments
Post a Comment