Resistribute vib_analyze pylab.hold()s to avoid auto-generated axis.
authorW. Trevor King <wking@drexel.edu>
Wed, 26 Nov 2008 21:07:58 +0000 (16:07 -0500)
committerW. Trevor King <wking@drexel.edu>
Wed, 26 Nov 2008 21:07:58 +0000 (16:07 -0500)
With the previous setup, the first call to hold() created a subplot(111)
axis that the rest of the subplots wrote over.  Ugly.  Better now.

calibcant/vib_analyze.py

index 8bd92747c98f267e8374757c11a9ab2849e29685..dc4af3b494684117127e619e3098ddbefd87024f 100755 (executable)
@@ -254,15 +254,16 @@ def vib_plot(deflection_bits, freq_axis, power, A, B, C,
         print "plotting"
         common._import_pylab()
         common._pylab.figure(config.BASE_FIGNUM+2)
-        common._pylab.hold(False)
 
         # plot time series
         common._pylab.subplot(311)
+        common._pylab.hold(False)
         common._pylab.plot(deflection_bits, 'r.')
         common._pylab.title("free oscillation")
 
         # plot histogram distribution and gaussian fit
         common._pylab.subplot(312)
+        common._pylab.hold(False)
         n, bins, patches = \
             common._pylab.hist(deflection_bits, bins=30,
                                normed=1, align='center')
@@ -279,6 +280,7 @@ def vib_plot(deflection_bits, freq_axis, power, A, B, C,
 
         # plot FFTed data
         axes = common._pylab.subplot(313)
+        common._pylab.hold(False)
         common._pylab.semilogy(freq_axis, power, 'r.-')
         fitdata = C / ((A**2-freq_axis**2)**2 + (B*freq_axis)**2)
         xmin,xmax = axes.get_xbound()