本文整理汇总了Python中mpl_toolkits.axes_grid.axislines.SubplotZero.hist方法的典型用法代码示例。如果您正苦于以下问题:Python SubplotZero.hist方法的具体用法?Python SubplotZero.hist怎么用?Python SubplotZero.hist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mpl_toolkits.axes_grid.axislines.SubplotZero
的用法示例。
在下文中一共展示了SubplotZero.hist方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import hist [as 别名]
def run(self, results):
par = self.getValueOfParameter("parameter")
i = int(self.getValueOfParameter("iteration number"))
title = self.getValueOfParameter("title")
if(par==""):
return False
if(i >= results.__len__()):
return False
dialogform = Dialog(QApplication.activeWindow())
fig = Figure((5.0, 4.0), dpi=100)
ax = SubplotZero(fig, 1, 1, 1)
fig.add_subplot(ax)
for n in ["top", "right"]:
ax.axis[n].set_visible(False)
for n in ["bottom", "left"]:
ax.axis[n].set_visible(True)
x = results[i].getResults(par)
if(not(x.__len__())):
return False
ax.hist(x, 100, normed=1)
ax.set_xlabel('Error')
ax.set_ylabel('Probability')
ax.grid(True)
ax.set_title(title)
dialogform.showFigure(fig)
return True
示例2: ficthist
# 需要导入模块: from mpl_toolkits.axes_grid.axislines import SubplotZero [as 别名]
# 或者: from mpl_toolkits.axes_grid.axislines.SubplotZero import hist [as 别名]
cur_x0 = cur_x0 + (cur_a1 - cur_x0)/(i + 2)
cur_x1 = cur_x1 + (cur_a0 - cur_x1)/(i + 2)
return x0s, x1s
def ficthist(t):
x0_last = []
for i in range(t):
x0s, x1s = fict(t)
x0_last.append(x0s[-1])
return x0_last
x0s, x1s = fict(t)
fig, ax = plt.subplots()
ax.plot(x0s, 'r-')
ax.plot(x1s, 'b-')
#plt.savefig('fictitious.png')
#plt.savefig('fictitious.pdf')
plt.show()
fig = plt.figure()
ax = SubplotZero(fig, 111)
fig.add_subplot(ax)
ax.hist(ficthist(t))
#plt.savefig('fictitious_hist.png')
#plt.savefig('fictitious_hist.pdf')
plt.show()