From f7b17f258e33ac9742742db7a0c71f34fa93ea41 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 26 Mar 2012 16:40:36 -0400 Subject: [PATCH] Use tight autoscaling for vibration plots. --- calibcant/vibration_analyze.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/calibcant/vibration_analyze.py b/calibcant/vibration_analyze.py index 107ca38..8959d37 100644 --- a/calibcant/vibration_analyze.py +++ b/calibcant/vibration_analyze.py @@ -512,6 +512,7 @@ def plot(deflection=None, freq_axis=None, power=None, A=None, B=None, if deflection is not None: time_axes.plot(deflection, 'r.') + time_axes.autoscale(tight=True) time_axes.set_title('free oscillation') # plot histogram distribution and gaussian fit @@ -527,10 +528,12 @@ def plot(deflection=None, freq_axis=None, power=None, A=None, B=None, # Matplotlib's normed histogram uses bin heights of n/(len(x)*dbin) dbin = bins[1]-bins[0] hist_axes.plot(bins, gauss/dbin, 'r-') + hist_axes.autoscale(tight=True) if power is not None: freq_axes.hold(True) freq_axes.set_yscale('log') freq_axes.plot(freq_axis, power, 'r.-') + freq_axes.autoscale(tight=True) xmin,xmax = freq_axes.get_xbound() ymin,ymax = freq_axes.get_ybound() -- 2.26.2