【发布时间】:2015-05-27 11:23:48
【问题描述】:
我想从底部开始。如何将起点从零更改为例如-2 ?
我的代码:
import matplotlib.pyplot as plt
import numpy as np
N=1000
sample=np.random.random_integers(1,10,N)
hist,bins=np.histogram(sample)
plt.bar(bins[:-1],np.log10(1.*hist/N),np.diff(bins))
plt.show()
输出:
【问题讨论】:
-
抱歉,因为我意识到另一件事,所以删除了评论。我想你会发现它确实发生了变化,但只是轻微的变化。
标签: python matplotlib plot axes