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=%s,fillcolor=%s,opacity=%s,hatchcolor=%s]' %(drawobject.getErrorBandStyle(),drawobject.getErrorBandColor(),drawobject.getErrorBandOpacity(),drawobject.getHatchColor()))
out += ('(%s, %s)(%s, %s)\n' %(xpos1,boxtop,xpos2,boxbottom))
# set psline options for all lines to be drawn next
out += zticks.draw(custommajortickmarks=zcustommajortickmarks,\
customminortickmarks=zcustomminortickmarks,\
custommajorticks=zcustommajorticks,\
customminorticks=zcustomminorticks,
drawlabels=drawzlabels)
out += ' }\n'
out += '}\n'
return out
class Labels(Described):
def __init__(self, description):
self.description = description
def draw(self, axis=[]):
out = ""
out += ('\n%\n% Labels\n%\n')
if 'Title' in self.description and (axis.count('Title') or axis==[]):
out += ('\\rput(0,1){\\rput[lB](0, 1.7\\labelsep){\\normalsize '+self.description['Title']+'}}\n')
if 'XLabel' in self.description and (axis.count('XLabel') or axis==[]):
xlabelsep = 4.7
if 'XLabelSep' in self.description:
xlabelsep=float(self.description['XLabelSep'])
out += ('\\rput(1,0){\\rput[rB](0,-%4.3f\\labelsep){\\normalsize '%(xlabelsep) +self.description['XLabel']+'}}\n')
if 'YLabel' in self.description and (axis.count('YLabel') or axis==[]):
ylabelsep = 6.5
if 'YLabelSep' in self.description:
ylabelsep=float(self.description['YLabelSep'])
out += ('\\rput(0,1){\\rput[rB]{90}(-%4.3f\\labelsep,0){\\normalsize '%(ylabelsep) +self.description['YLabel']+'}}\n')
if 'ZLabel' in self.description and (axis.count('ZLabel') or axis==[]):
zlabelsep = 6.5
if 'ZLabelSep' in self.description:
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')
print('+++ Error in Histogram.getRMSdistance() for %s: binning of histograms differs' % self.path)
distance = sqrt(distance/sumofweights)
return distance
def draw(self,coors):
seen_nan = False
out = ""
out += self.startclip()
out += self.startpsset()
if any(b.isValid for b in self.data):
out += "% START DATA\n"
if self.is2dim:
for b in self.data:
out += ('\\psframe')
color = int(129*coors.phys2frameZ(b.val))
if b.val > coors.zmax():
color = 129
if b.val < coors.zmin():
color = 0
if b.val <= coors.zmin():
out += ('[linewidth=0pt, linestyle=none, fillstyle=solid, fillcolor=white]')
else:
out += ('[linewidth=0pt, linestyle=none, fillstyle=solid, fillcolor={gradientcolors!!['+str(color)+']}]')
out += ('(' + coors.strphys2frameX(b.low[0]) + ', ' \
+ coors.strphys2frameY(b.low[1]) + ')(' \
+ coors.strphys2frameX(b.high[0]) + ', ' \
+ coors.strphys2frameY(b.high[1]) + ')\n')
else:
if self.getErrorBands():
self.description['SmoothLine'] = 0
for b in self.data:
if isnan(b.val) or isnan(b.err[0]) or isnan(b.err[1]):
seen_nan = True
continue
out += ('\\psframe[dimen=inner,linewidth=0pt,linestyle=none,fillstyle=%s,fillcolor=%s,opacity=%s,hatchcolor=%s]' %(self.getErrorBandStyle(),self.getErrorBandColor(),self.getErrorBandOpacity(),self.getHatchColor()))
out += ('(' + coors.strphys2frameX(b.xmin) + ', ' \
+ coors.strphys2frameY(b.val - b.err[0]) + ')(' \
+ coors.strphys2frameX(b.xmax) + ', ' \
+ coors.strphys2frameY(b.val + b.err[1]) + ')\n')
if self.getErrorBars():
for b in self.data:
if isnan(b.val) or isnan(b.err[0]) or isnan(b.err[1]):
seen_nan = True
continue
if b.val == 0. and b.err == [0.,0.]:
continue
out += ('\\psline')
out += ('(' + coors.strphys2frameX(b.xmin) + ', ' \
uselog = self.description['LogX'] and (self.coors.xmin() > 0 and self.coors.xmax() > 0)
out += self.draw_ticks(self.coors.xmin(), self.coors.xmax(),\
plotlog=uselog,\
custommajorticks=custommajorticks,\
customminorticks=customminorticks,\
custommajortickmarks=custommajortickmarks,\
customminortickmarks=customminortickmarks,\
twosided=twosided,\
drawlabels=drawlabels)
out += self.draw_breaks(self.coors.ymin(), self.coors.ymax(),\
breaks, twosided)
return out
def add_definitions(self):
self.read_parameters()
out = ''
out += ('\\def\\majortickmarkx{\\psline[linewidth='+self.majorticklinewidth+',linecolor='+self.majorticklinecolor+'](0,0)(0,'+self.majorticklength+')}%\n')
out += ('\\def\\minortickmarkx{\\psline[linewidth='+self.minorticklinewidth+',linecolor='+self.minorticklinecolor+'](0,0)(0,'+self.minorticklength+')}%\n')
out += ('\\uput[180]{0}(0, '+pos+'){\\strut{}'+label+'}\n')
out += self.draw_breaks(self.coors.ymin(), self.coors.ymax(),\
breaks, twosided)
return out
def add_definitions(self):
self.read_parameters()
out = ''
out += ('\\def\\majortickmarky{\\psline[linewidth='+self.majorticklinewidth+',linecolor='+self.majorticklinecolor+'](0,0)('+self.majorticklength+',0)}%\n')
out += ('\\def\\minortickmarky{\\psline[linewidth='+self.minorticklinewidth+',linecolor='+self.minorticklinecolor+'](0,0)('+self.minorticklength+',0)}%\n')
out += ('\\def\\majortickmarkz{\\psline[linewidth='+self.majorticklinewidth+',linecolor='+self.majorticklinecolor+'](0,0)('+self.majorticklength+',0)}%\n')
out += ('\\def\\minortickmarkz{\\psline[linewidth='+self.minorticklinewidth+',linecolor='+self.minorticklinecolor+'](0,0)('+self.minorticklength+',0)}%\n')
out += self.draw_ticks(self.coors.zmin(), self.coors.zmax(),\