How can I set the y axis of the second subplot [0,1000]? The FFT plot of my data (a column in a text file) is a result of a (ing.) Spike so that the actual data is not visible.
pylab.ylim ([0,1000])
has no effect, unfortunately. This is the complete script: http://www.swharden.com/blog/2009-01-21-signal-filtering-with-python/ import numpy, scipy, f based on
# : Line for f: if line [0]! = '#' And len (line) & gt; Pylab, random xs = [] rawsignal = [] with open ("test.dat", 'r') 0: xs.append (int (line.split () [0]) rawsignal.append (int .split () [1]) h, w = 3, 1 pylab.figure (figsize = (12, 9)) pylab.subplots_adjust (hspace = .7) pylab.subplot (h, w, 1) pylab.title ("Signal") pylab.plot (xs, rawsignal) pylab.subplot (h, w, 2) pylab. Title ("FFT") fft = scipy.fft (rawsignal) # ~ pylab.axis ([none, none, 0,1000]) pylab.ylim ([0,1000]) pylab.plot (abs (fft) ) Pylab .savefig ("SIG.png", dpi = 200) pylab.show ()
Other improvements are also appreciated!
as has been found
pylab.ylim ( [0,1000])
Note: After the plot, the command must be executed!
Comments
Post a Comment