if (inputdata.description.has_key('RatioPlot') and inputdata.description['RatioPlot']=='1') or (inputdata.description.has_key('PlotXTickLabels') and inputdata.description['PlotXTickLabels']=='0'):
drawxlabels=False
else:
drawxlabels=True
out += xticks.draw(custommajortickmarks=xcustommajortickmarks,\
customminortickmarks=xcustomminortickmarks,\
custommajorticks=xcustommajorticks,\
customminorticks=xcustomminorticks,\
drawlabels=drawxlabels)
if inputdata.description.has_key('YMajorTickMarks') and inputdata.description['YMajorTickMarks']!='':
for legend in self.description['LegendOnly'].strip().split():
if legend in self.histos.keys() or legend in self.functions.keys():
legendlist.append(legend)
for legend in legendlist:
order = 0
if self.histos.has_key(legend) and self.histos[legend].description.has_key('LegendOrder'):
order = int(self.histos[legend].description['LegendOrder'])
if self.functions.has_key(legend) and self.functions[legend].description.has_key('LegendOrder'):
order = int(self.functions[legend].description['LegendOrder'])
if not order in legendordermap:
legendordermap[order] = []
legendordermap[order].append(legend)
foo=[]
for i in sorted(legendordermap.keys()):
foo.extend(legendordermap[i])
rel_xpos_sign = 1.0
if self.getLegendAlign()=='r':
rel_xpos_sign = -1.0
xpos1 = -0.10*rel_xpos_sign
xpos2 = -0.02*rel_xpos_sign
for i in foo:
if self.histos.has_key(i):
drawobject=self.histos[i]
elif self.functions.has_key(i):
drawobject=self.functions[i]
else:
continue
title = drawobject.getTitle()
if title == '':
continue
else:
out += ('\\rput[B%s](%s,%s){%s}\n' %(self.getLegendAlign(),rel_xpos_sign*0.1,ypos,title))
out += ('\\rput[B%s](%s,%s){%s\n' %(self.getLegendAlign(),rel_xpos_sign*0.1,ypos,'%'))
if drawobject.getErrorBands():
out += ('\\psframe[linewidth=0pt,linestyle=none,fillstyle=solid,fillcolor=%s,opacity=%s]' %(drawobject.getErrorBandColor(),drawobject.getErrorBandOpacity()))
out += ('(%s, 0.033)(%s, 0.001)\n' %(xpos1, xpos2))
out += ('\\psline[linestyle=' + drawobject.getLineStyle() \
if (self.description.has_key('PlotZTickLabels') and self.description['PlotZTickLabels']=='0'):
drawzlabels=False
else:
drawzlabels=True
zticks = ZTicks(self.description, self.coors)
out += zticks.draw(custommajortickmarks=zcustommajortickmarks,\
customminortickmarks=zcustomminortickmarks,\
custommajorticks=zcustommajorticks,\
customminorticks=zcustomminorticks,
drawlabels=drawzlabels)
out += ' }\n'
out += '}\n'
return out
class Labels(object):
def __init__(self, description):
self.description = description
def draw(self, axis=[]):
out = ""
out += ('\n%\n% Labels\n%\n')
if self.description.has_key('Title') and (axis.count('Title') or axis==[]):
out += ('\\rput(0,1){\\rput[lB](0, 1.7\\labelsep){\\normalsize '+self.description['Title']+'}}\n')
if self.description.has_key('XLabel') and (axis.count('XLabel') or axis==[]):
xlabelsep=4.7
if self.description.has_key('XLabelSep'):
xlabelsep=float(self.description['XLabelSep'])
out += ('\\rput(1,0){\\rput[rB](0,-%4.3f\\labelsep){\\normalsize '%(xlabelsep) +self.description['XLabel']+'}}\n')
if self.description.has_key('YLabel') and (axis.count('YLabel') or axis==[]):
ylabelsep=6.5
if self.description.has_key('YLabelSep'):
ylabelsep=float(self.description['YLabelSep'])
out += ('\\rput(0,1){\\rput[rB]{90}(-%4.3f\\labelsep,0){\\normalsize '%(ylabelsep) +self.description['YLabel']+'}}\n')
if self.description.has_key('ZLabel') and (axis.count('ZLabel') or axis==[]):
zlabelsep=5.3
if self.description.has_key('ZLabelSep'):
zlabelsep=float(self.description['ZLabelSep'])
out += ('\\rput(1,1){\\rput(%4.3f\\labelsep,0){\\psset{xunit=4mm}\\rput[lB]{270}(1.5,0){\\normalsize '%(zlabelsep) +self.description['ZLabel']+'}}}\n')
out += ('\\psframe[dimen=inner,linewidth=0pt,linestyle=none,fillstyle=solid,fillcolor=%s,opacity=%s]' %(self.getErrorBandColor(),self.getErrorBandOpacity()))
out += ('(' + coors.strphys2frameX(self.data[i]['LowEdge']) + ', ' \