Use tight autoscaling for vibration plots.
authorW. Trevor King <wking@drexel.edu>
Mon, 26 Mar 2012 20:40:36 +0000 (16:40 -0400)
committerW. Trevor King <wking@drexel.edu>
Mon, 26 Mar 2012 20:40:36 +0000 (16:40 -0400)
calibcant/vibration_analyze.py

index 107ca3882cbfa496a532c55d82d22d0a54ae4e31..8959d372bce29d93bf9aed4afe7ee7657122791e 100644 (file)
@@ -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.')
 
     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
         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-')
         # 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.-')
     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()
     
         xmin,xmax = freq_axes.get_xbound()
         ymin,ymax = freq_axes.get_ybound()