【发布时间】:2020-08-19 07:16:15
【问题描述】:
我尝试了很多次,但我的直方图 id 没有显示图形,只显示轴线。这是我用来绘制直方图的代码。请帮忙!
%matplotlib inline
bins = np.linspace(0, 2, 40)
plt.figure(figsize=(20,10))
plt.hist(x_input, bins, alpha=0.5, histtype='bar')
plt.legend(['Red', 'Blue','Green'])
plt.axis([1,500,0,300])
plt.show()
【问题讨论】:
-
x_input 包含什么?你能给出输入的一些范围值吗?
-
尝试删除
plt.axis([1,500,0,300])的相同代码
标签: python matplotlib data-science