From: W. Trevor King Date: Wed, 26 Nov 2008 21:07:58 +0000 (-0500) Subject: Resistribute vib_analyze pylab.hold()s to avoid auto-generated axis. X-Git-Tag: 0.3~10 X-Git-Url: http://git.tremily.us/?p=calibcant.git;a=commitdiff_plain;h=3ca8607af42119f280da77cc7fcfe3242dc38dbc Resistribute vib_analyze pylab.hold()s to avoid auto-generated axis. 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. --- diff --git a/calibcant/vib_analyze.py b/calibcant/vib_analyze.py index 8bd9274..dc4af3b 100755 --- a/calibcant/vib_analyze.py +++ b/calibcant/vib_analyze.py @@ -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()