本文整理汇总了Python中param.parameterized.ParamOverrides.filename_suffix方法的典型用法代码示例。如果您正苦于以下问题:Python ParamOverrides.filename_suffix方法的具体用法?Python ParamOverrides.filename_suffix怎么用?Python ParamOverrides.filename_suffix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类param.parameterized.ParamOverrides
的用法示例。
在下文中一共展示了ParamOverrides.filename_suffix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __call__
# 需要导入模块: from param.parameterized import ParamOverrides [as 别名]
# 或者: from param.parameterized.ParamOverrides import filename_suffix [as 别名]
def __call__(self,output_fn,init_time=0,final_time=None,**params):
p=ParamOverrides(self,params)
if final_time is None:
final_time=topo.sim.time()
attrs = p.attrib_names if len(p.attrib_names)>0 else output_fn.attrib_names
for a in attrs:
pylab.figure(figsize=(6,4))
isint=pylab.isinteractive()
pylab.ioff()
pylab.grid(True)
ylabel=p.ylabel
pylab.ylabel(a+" "+ylabel)
pylab.xlabel('Iteration Number')
coords = p.units if len(p.units)>0 else output_fn.units
for coord in coords:
y_data=[y for (x,y) in output_fn.values[a][coord]]
x_data=[x for (x,y) in output_fn.values[a][coord]]
if p.raw==True:
plot_data=zip(x_data,y_data)
pylab.save(normalize_path(p.filename+a+'(%.2f, %.2f)' %(coord[0], coord[1])),plot_data,fmt='%.6f', delimiter=',')
pylab.plot(x_data,y_data, label='Unit (%.2f, %.2f)' %(coord[0], coord[1]))
(ymin,ymax)=p.ybounds
pylab.axis(xmin=init_time,xmax=final_time,ymin=ymin,ymax=ymax)
if isint: pylab.ion()
pylab.legend(loc=0)
p.title=topo.sim.name+': '+a
p.filename_suffix=a
self._generate_figure(p)
示例2: __call__
# 需要导入模块: from param.parameterized import ParamOverrides [as 别名]
# 或者: from param.parameterized.ParamOverrides import filename_suffix [as 别名]
def __call__(self, **params):
p=ParamOverrides(self,params)
name=p.plot_template.keys().pop(0)
plot=make_template_plot(p.plot_template,
p.sheet.views.Maps, p.sheet.xdensity,p.sheet.bounds,
p.normalize,name=p.plot_template[name])
fig = plt.figure(figsize=(5,5))
if plot:
bitmap=plot.bitmap
isint=plt.isinteractive() # Temporarily make non-interactive for plotting
plt.ioff() # Turn interactive mode off
plt.imshow(bitmap.image,origin='lower',interpolation='nearest')
plt.axis('off')
for (t,pref,sel,c) in p.overlay:
v = plt.flipud(p.sheet.views.Maps[pref].view()[0])
if (t=='contours'):
plt.contour(v,[sel,sel],colors=c,linewidths=2)
if (t=='arrows'):
s = plt.flipud(p.sheet.views.Maps[sel].view()[0])
scale = int(np.ceil(np.log10(len(v))))
X = np.array([x for x in xrange(len(v)/scale)])
v_sc = np.zeros((len(v)/scale,len(v)/scale))
s_sc = np.zeros((len(v)/scale,len(v)/scale))
for i in X:
for j in X:
v_sc[i][j] = v[scale*i][scale*j]
s_sc[i][j] = s[scale*i][scale*j]
plt.quiver(scale*X, scale*X, -np.cos(2*np.pi*v_sc)*s_sc,
-np.sin(2*np.pi*v_sc)*s_sc, color=c,
edgecolors=c, minshaft=3, linewidths=1)
p.title='%s overlaid with %s at time %s' %(plot.name,pref,topo.sim.timestr())
if isint: plt.ion()
p.filename_suffix="_"+p.sheet.name
self._generate_figure(p)
return fig