[Rivet-svn] r2165 - trunk/pyext

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu Dec 10 15:44:00 GMT 2009


Author: hoeth
Date: Thu Dec 10 15:44:00 2009
New Revision: 2165

Log:
Don't write "None" all over the plots

Modified:
   trunk/pyext/lighthisto.py

Modified: trunk/pyext/lighthisto.py
==============================================================================
--- trunk/pyext/lighthisto.py	Thu Dec 10 13:37:27 2009	(r2164)
+++ trunk/pyext/lighthisto.py	Thu Dec 10 15:44:00 2009	(r2165)
@@ -38,9 +38,9 @@
         # the observable name, e.g. d01-x02-y01
         self.name = None
         # the histogram title
-        self.title = None
-        self.xlabel = None
-        self.ylabel = None
+        self.title = ''
+        self.xlabel = ''
+        self.ylabel = ''
         self._sorted = False
 
     def __cmp__(self, other):
@@ -98,9 +98,9 @@
     def asGnuplot(self):
         out  = "## HISTOGRAM: %s\n" % self.fullPath()
         out += "## Title: %s\n" % self.title
-        if self.xlabel:
+        if (self.xlabel!=''):
             out += "## XLabel: %s\n" % self.xlabel
-        if self.ylabel:
+        if (self.ylabel!=''):
             out += "## YLabel: %s\n" % self.ylabel
         out += "## Area: %s\n" % self.area()
         out += "## Num bins: %d\n" % self.numBins()
@@ -119,14 +119,14 @@
         else:
             r += ind + '    path="%s" title="">\n' % (
                     os.path.dirname(self.path))
-        if self.xlabel is not None:
+        if (self.xlabel!=''):
             r += ind + '  <dimenstion dim="0" title="%s"/>\n' % (
                     htmlescape(self.xlabel))
-        if self.ylabel is not None:
+        if (self.ylabel!=''):
             r += ind + '  <dimenstion dim="1" title="%s"/>\n' % (
                     htmlescape(self.ylabel))
         r += ind + "  <annotation>\n"
-        if self.title is not None:
+        if (self.title!=''):
             r += ind + '    <item key="Title" value="%s" sticky="true"/>\n' % (
                     htmlescape(self.title))
         else:


More information about the Rivet-svn mailing list