How to get a three-dimensional histogram from two-dimensional data?

别说谁变了你拦得住时间么 提交于 2019-12-02 10:12:15

add this line to the first line of your code:

from mpl_toolkits.mplot3d import Axes3D

Updated Hope this will help you.

from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

x=[2006, 2007, 2008, 2009, 2010]
z=[700, 560, 450, 500, 570]
ax.bar3d(x, 0, 0, 0.5, 0.5, z)
plt.show()

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!