From 991e1333b1bccc0df551d6929617ff30d5cef5cd Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@gmail.com>
Date: Sat, 14 Jan 2017 21:33:07 +0000
Subject: [PATCH] sample analysis correction

---
 nir_log |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/nir_log b/nir_log
index 34fc24b..9deaece 100644
--- a/nir_log
+++ b/nir_log
@@ -115,13 +115,14 @@
 
 	fig=plt.figure(1)
 	ra=running_avg(table['hbar'])
+	l=len(table['hbar'])
 	plt.plot(ra)
 	plt.title('Running average')
 	plt.ylabel('1/n sum_i=niter^n(hbar_i)')
 	plt.xlabel('n')
 	def onclick(event):
-		print('button=%d, x=%d, y=%d, xdata=%f, ydata=%f' % (event.button, event.x, event.y, event.xdata, event.ydata))
-		p=Process(target=spawned_viewer, args=(math.floor(event.xdata)-1,))
+		#print('button=%d, x=%d, y=%d, xdata=%f, ydata=%f' % (event.button, event.x, event.y, event.xdata, event.ydata))
+		p=Process(target=spawned_viewer, args=(l-math.floor(event.xdata)-1,))
 		p.start()
 	cid = fig.canvas.mpl_connect('button_press_event', onclick)
 	plt.show()

--
Gitblit v1.9.3