本文整理汇总了Python中biggles.FramedPlot.title方法的典型用法代码示例。如果您正苦于以下问题:Python FramedPlot.title方法的具体用法?Python FramedPlot.title怎么用?Python FramedPlot.title使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类biggles.FramedPlot
的用法示例。
在下文中一共展示了FramedPlot.title方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_frac_plot
# 需要导入模块: from biggles import FramedPlot [as 别名]
# 或者: from biggles.FramedPlot import title [as 别名]
def make_frac_plot(self):
if self.shnum not in sh1exp:
raise ValueError("you must know the expected value")
if sh1exp[self.shnum] != 0:
gfield='g1'
gtrue=sh1exp[self.shnum]
elif sh2exp[self.shnum] != 0:
gfield='g2'
gtrue=sh2exp[self.shnum]
else:
raise ValueError("all expected are listed as zero")
bindata=self.bindata
bin_field=self.bin_field
plt=FramedPlot()
plt.title=self.get_title()
plt.xlog=True
plt.xrange=[0.5*bindata[bin_field].min(), 1.5*bindata[bin_field].max()]
plt.xlabel=bin_field
ylabel=r'$\Delta \gamma/\gamma$'
plt.ylabel = ylabel
xdata=bindata[bin_field]
zero=zeros(xdata.size)
zero_plt=Curve(xdata, zero)
plt.add(zero_plt)
xfill=[xdata.min(), xdata.max()]
plt.add( biggles.FillBetween(xfill, [0.004,0.004],
xfill, [-0.004,-0.004],
color='grey80'))
gfrac = bindata[gfield]/gtrue-1
gfrac_err = bindata[gfield+'_err']/gtrue
type='filled circle'
color='blue'
gpts = Points(xdata, gfrac, type=type, color=color)
gerrpts = SymmetricErrorBarsY(xdata, gfrac, gfrac_err,color=color)
plt.add( gpts, gerrpts )
self.plt=plt
示例2: doplot
# 需要导入模块: from biggles import FramedPlot [as 别名]
# 或者: from biggles.FramedPlot import title [as 别名]
def doplot(self, fitres, h, minmag, maxmag):
tab=biggles.Table(2,1)
plt=FramedPlot()
plt.title='%s %.2f %.2f ' % (self.objtype, minmag, maxmag)
plt.xlabel=r'$\sigma$'
sprior=fitres.get_model()
nrand=100000
binsize=self.binsize
hplt=Histogram(h['hist'], x0=h['low'][0], binsize=binsize)
hplt.label='data'
srand=sprior.sample(nrand)
hrand=histogram(srand, binsize=binsize, min=h['low'][0], max=h['high'][-1], more=True)
hrand['hist'] = hrand['hist']*float(h['hist'].sum())/nrand
hpltrand=Histogram(hrand['hist'], x0=hrand['low'][0], binsize=binsize,
color='blue')
hpltrand.label='rand'
key=PlotKey(0.9,0.9,[hplt,hpltrand],halign='right')
plt.add(hplt, hpltrand, key)
tplt=fitres.plot_trials(show=False,fontsize_min=0.88888888)
tab[0,0] = plt
tab[1,0] = tplt
if self.show:
tab.show()
d=files.get_prior_dir()
d=os.path.join(d, 'plots')
epsfile='pofs-%.2f-%.2f-%s.eps' % (minmag,maxmag,self.objtype)
epsfile=os.path.join(d,epsfile)
eu.ostools.makedirs_fromfile(epsfile)
print epsfile
tab.write_eps(epsfile)
os.system('converter -d 100 %s' % epsfile)
return tab