[Rivet] [PATCH] filter nan's in make-plots

Dmitry Kalinkin dmitry.kalinkin at gmail.com
Wed Jul 12 07:09:57 BST 2017


Hi,

There is a bug in make-plots which prevents it from generating correct latex when I try to compare TProfile1D’s with occasional empty bins. Patch below fixes the problem for me. Could you please integrate it.

Thanks,

Best,
Dmitry

diff --git a/bin/make-plots b/bin/make-plots
index 4cbdfacf..ecaf4dbe 100755
--- a/bin/make-plots
+++ b/bin/make-plots
@@ -1810,6 +1810,9 @@ class Histogram(DrawableObject, Described):
                 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=solid,fillcolor=%s,opacity=%s]' % (self.getErrorBandColor(),self.getErrorBandOpacity()))
                         out += ('(' + coors.strphys2frameX(b.xmin) + ', ' \
                                     + coors.strphys2frameY(b.val - b.err[0]) + ')(' \



More information about the Rivet mailing list