From 48846d3fb4bbe41375c340325592c8b00a8b7765 Mon Sep 17 00:00:00 2001
From: Frank Sauerburger <f.sauerburger@cern.ch>
Date: Thu, 12 Nov 2020 12:56:53 +0100
Subject: [PATCH] Add support for vertical lines

---
 nnfwtbn/plot.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/nnfwtbn/plot.py b/nnfwtbn/plot.py
index 4069081..12d6bd2 100644
--- a/nnfwtbn/plot.py
+++ b/nnfwtbn/plot.py
@@ -299,6 +299,7 @@ def uhepp_hist(dataframe, variable, bins, stacks, selection=None,
 
             uhepp_obj.ratio.append(uhepp_ritem)
 
+    ##################
     # Compute delayed dask 
     yields, = dask.compute(yields)
     for key, item in yields.items():
@@ -306,7 +307,14 @@ def uhepp_hist(dataframe, variable, bins, stacks, selection=None,
 
     # TODO: Reorder processes if y_log
 
-    # TODO: vertical and horizontal lines
+    ##################
+    # Vertical lines
+    for vline in vlines:
+        if isinstance(vline, (int, float)):
+            uhepp_obj.v_lines.append(uhepp.VLine(vline))
+        else:
+            pos_x = vline.pop("x")
+            uhepp_obj.v_lines.append(uhepp.VLine(pos_x, **vline))
 
     if return_uhepp:
         return uhepp_obj
-- 
GitLab