From: W. Trevor King Date: Mon, 26 Mar 2012 20:40:36 +0000 (-0400) Subject: Use tight autoscaling for vibration plots. X-Git-Tag: 0.8~26 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f7b17f258e33ac9742742db7a0c71f34fa93ea41;p=calibcant.git Use tight autoscaling for vibration plots. --- 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()