本文整理汇总了Python中Graphics.smooth方法的典型用法代码示例。如果您正苦于以下问题:Python Graphics.smooth方法的具体用法?Python Graphics.smooth怎么用?Python Graphics.smooth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graphics
的用法示例。
在下文中一共展示了Graphics.smooth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dict
# 需要导入模块: import Graphics [as 别名]
# 或者: from Graphics import smooth [as 别名]
filename = lambda ru: os.path.join(basedir,'all-results-0-%s-%s.pkl'%(ru[0],ru[1]))
data = {'%s-%s'%(r,u):cPickle.load(open(filename((r,u)),'rb')) for r in r_schema for u in u_schema}
formats = dict(zip(u_schema,['k','k--','k-.']))
sn = lambda alpha: (1-alpha)/alpha if alpha > 0 else 0
mixing_fractions = np.linspace(0,1,num=11)
accuracies = {}
fig,axs = plt.subplots(ncols=len(r_schema))
for reward,panel in zip(r_schema,axs):
for stimulus in u_schema:
accuracy = postdoc.accuracy_figure(data['%s-%s'%(reward,stimulus)],savename=None)
panel.plot(artist.smooth(accuracy,beta=2),formats[stimulus],linewidth=2,label=artist.format(stimulus.capitalize()))
accuracies['%s-%s'%(reward,stimulus)] = accuracy
artist.adjust_spines(panel)
panel.set_xlabel(r'\Large $\mathrm{\frac{Signal}{Noise}}$')
panel.set_ylabel(r'\Large \textbf{%s, } $\mathrm{Accuracy, q\left(\mathbf{v}\right)\Bigg|_{\mathbf{v^0}}} $'%reward.capitalize())
panel.set_ylim((-1,1))
xlabs = [r'\Large $\mathbf{%.02f}$'%alpha for alpha in map(sn,mixing_fractions[:-1])]
xlabs[0] = r'\Large $\mathrm{All \; signal}$'
xlabs[-1] = r'\Large $\mathrm{All \; noise}$'
panel.set_xticklabels(xlabs, rotation='vertical')
plt.legend(frameon=False)
示例2: dict
# 需要导入模块: import Graphics [as 别名]
# 或者: from Graphics import smooth [as 别名]
'''
basedir = '/Volumes/My Book/synchrony-data/2013-12-29-13-26-12'
r_schema = ['susceptible','resilient']
u_schema = ['exposure','chronic','cessation']
filename = lambda ru: os.path.join(basedir,'all-results-0-%s-%s.pkl'%(ru[0],ru[1]))
data = {'%s-%s'%(r,u):cPickle.load(open(filename((r,u)),'rb')) for r in r_schema for u in u_schema}
formats = dict(zip(u_schema,['k','k--','k-.']))
fig,axs = plt.subplots(nrows=1,ncols=2,sharex=True,sharey=True)
for reward,ax in zip(r_schema,axs):
for stimulus in u_schema:
ax.plot(artist.smooth(data['%s-%s'%(reward,stimulus)]['network_stability']),formats[stimulus],
linewidth=2,label=artist.format(stimulus.capitalize()))
plt.hold(True)
ax.annotate(artist.format(reward.capitalize()), xy=(.2, .7), xycoords='axes fraction',
horizontalalignment='center', verticalalignment='center')
artist.adjust_spines(ax)
ax.set_xlabel(artist.format('Time'))
ax.set_ylabel(r'\Large $E\left(\mathbf{v}\right)$')
plt.legend(frameon=False)
plt.tight_layout()
plt.show()