|
[Rivet-svn] r2837 - in trunk: . bin docblackhole at projects.hepforge.org blackhole at projects.hepforge.orgWed Dec 8 14:13:46 GMT 2010
Author: hoeth Date: Wed Dec 8 14:13:46 2010 New Revision: 2837 Log: new HISTOGRAM option "SmoothLine" in make-plots Modified: trunk/ChangeLog trunk/bin/make-plots trunk/doc/make-plots.txt Modified: trunk/ChangeLog ============================================================================== --- trunk/ChangeLog Wed Dec 8 09:54:35 2010 (r2836) +++ trunk/ChangeLog Wed Dec 8 14:13:46 2010 (r2837) @@ -6,6 +6,8 @@ The paper will be out soon, and we don't need the other plots right now. Data is read off the plots in the note. + * New option "SmoothLine" for HISTOGRAM sections in make-plots + 2010-12-07 Andy Buckley <andy at insectnation.org> * Update the documentation to explain this latest bump to path Modified: trunk/bin/make-plots ============================================================================== --- trunk/bin/make-plots Wed Dec 8 09:54:35 2010 (r2836) +++ trunk/bin/make-plots Wed Dec 8 14:13:46 2010 (r2837) @@ -905,6 +905,12 @@ else: return 'yellow' + def getSmoothLine(self): + if self.description.has_key('SmoothLine'): + return bool(int(self.description['SmoothLine'])) + else: + return False + def startclip(self): return '\\psclip{\\psframe[linewidth=0, linestyle=none](0,0)(1,1)}\n' @@ -1161,26 +1167,34 @@ + coors.strphys2frameY(self.data[i]['Content']+self.data[i]['Error'][1]) + ')\n') else: if self.getErrorBands(): + self.description['SmoothLine']=0 for i in range(len(self.data)): out += ('\\psframe[dimen=inner,linewidth=0pt,linestyle=none,fillstyle=solid,fillcolor=%s]' %self.getErrorBandColor()) out += ('(' + coors.strphys2frameX(self.data[i]['LowEdge']) + ', ' \ + coors.strphys2frameY(self.data[i]['Content']-self.data[i]['Error'][0]) + ')(' \ + coors.strphys2frameX(self.data[i]['UpEdge']) + ', ' \ + coors.strphys2frameY(self.data[i]['Content']+self.data[i]['Error'][1]) + ')\n') - out += ('\psline') + if self.getSmoothLine(): + out += ('\pscurve') + else: + out += ('\psline') if (self.getFillStyle() != 'none'): # make sure that filled areas go all the way down to the x-axis if (coors.phys2frameX(self.data[0]['LowEdge']) > 1e-4): out += '(' + coors.strphys2frameX(self.data[0]['LowEdge']) + ', -0.1)\n' else: out += '(-0.1, -0.1)\n' for i in range(len(self.data)): - out += ('(' + coors.strphys2frameX(self.data[i]['LowEdge']) + ', ' \ - + coors.strphys2frameY(self.data[i]['Content']) + ')(' \ - + coors.strphys2frameX(self.data[i]['UpEdge']) + ', ' \ - + coors.strphys2frameY(self.data[i]['Content']) + ')\n') - if not (self.description.has_key('ConnectGaps') and self.description['ConnectGaps']=='1'): - if (i+1 < len(self.data)) and (abs(coors.phys2frameX(self.data[i]['UpEdge']) - coors.phys2frameX(self.data[i+1]['LowEdge'])) > 1e-4): - out += ('\\psline') + if self.getSmoothLine(): + out += ('(' + coors.strphys2frameX(0.5*(self.data[i]['LowEdge']+self.data[i]['UpEdge'])) + ', ' \ + + coors.strphys2frameY(self.data[i]['Content']) + ')\n') + else: + out += ('(' + coors.strphys2frameX(self.data[i]['LowEdge']) + ', ' \ + + coors.strphys2frameY(self.data[i]['Content']) + ')(' \ + + coors.strphys2frameX(self.data[i]['UpEdge']) + ', ' \ + + coors.strphys2frameY(self.data[i]['Content']) + ')\n') + if not (self.description.has_key('ConnectGaps') and self.description['ConnectGaps']=='1'): + if (i+1 < len(self.data)) and (abs(coors.phys2frameX(self.data[i]['UpEdge']) - coors.phys2frameX(self.data[i+1]['LowEdge'])) > 1e-4): + out += ('\\psline') if (self.getFillStyle() != 'none'): # make sure that filled areas go all the way down to the x-axis if (coors.phys2frameX(self.data[-1]['UpEdge']) < 1-1e-4): out += '(' + coors.strphys2frameX(self.data[-1]['UpEdge']) + ', -0.1)\n' Modified: trunk/doc/make-plots.txt ============================================================================== --- trunk/doc/make-plots.txt Wed Dec 8 09:54:35 2010 (r2836) +++ trunk/doc/make-plots.txt Wed Dec 8 14:13:46 2010 (r2837) @@ -386,6 +386,11 @@ affects all histograms, but you can also set it in the `HISTOGRAM` section for individual histograms. The local setting overrides the global settig. +-------------------- +SmoothLine=<0|1> +-------------------- +Draw a smooth curve rather than a histogram + Fillstyles ^^^^^^^^^^
More information about the Rivet-svn mailing list |