当前位置: 首页>>代码示例>>Python>>正文


Python Graphics.smooth方法代码示例

本文整理汇总了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)
开发者ID:mac389,项目名称:synchrony,代码行数:33,代码来源:make-results-figure-4.py

示例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()
开发者ID:mac389,项目名称:synchrony,代码行数:33,代码来源:make-results-figure-2.py


注:本文中的Graphics.smooth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。