From f4aa0fa9a2ac8a404488e77ff87345efbb43da03 Mon Sep 17 00:00:00 2001 From: silicium Date: Tue, 20 Feb 2018 17:27:17 +0100 Subject: [PATCH] min-max for plotting --- fit_waist.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fit_waist.py b/fit_waist.py index 6206f00..46348d7 100755 --- a/fit_waist.py +++ b/fit_waist.py @@ -45,8 +45,8 @@ print(popt[0], popt[1]) p[1].plot(data_waist[:,0], data_waist[:,1], 'bo') p[1].plot(data_waist[:,0], -data_waist[:,1], 'bo') -p[1].plot(numpy.linspace(data_waist[0,0], data_waist[-1,0], 100), W(numpy.linspace(data_waist[0,0], data_waist[-1,0], 100), *popt), 'r') -p[1].plot(numpy.linspace(data_waist[0,0], data_waist[-1,0], 100), -W(numpy.linspace(data_waist[0,0], data_waist[-1,0], 100), *popt), 'r') +p[1].plot(numpy.linspace(min(data_waist[:,0]), max(data_waist[:,0]), 100), W(numpy.linspace(min(data_waist[:,0]), max(data_waist[:,0]), 100), *popt), 'r') +p[1].plot(numpy.linspace(min(data_waist[:,0]), max(data_waist[:,0]), 100), -W(numpy.linspace(min(data_waist[:,0]), max(data_waist[:,0]), 100), *popt), 'r') p[1].grid() plt.show() -- 2.16.4