python/demos/demo_waveform_plot.py: also set x limits
authorPaul Brossier <piem@piem.org>
Fri, 22 Mar 2013 16:43:59 +0000 (11:43 -0500)
committerPaul Brossier <piem@piem.org>
Fri, 22 Mar 2013 16:43:59 +0000 (11:43 -0500)
python/demos/demo_waveform_plot.py

index 41314670ec206f74beb820249d17e29f07423354..0f1f02a1c786324726e898f245a131ae139fcf69 100755 (executable)
@@ -36,6 +36,7 @@ def get_waveform_plot(filename, samplerate = 0, block_size = 4096, ax = None):
     return ax
 
 def set_xlabels_sample2time(ax, latest_sample, samplerate):
+    ax.axis(xmin = 0, xmax = latest_sample)
     if latest_sample / float(samplerate) > 60:
         ax.set_xlabel('time (mm:ss)')
         ax.set_xticklabels([ "%02d:%02d" % (t/float(samplerate)/60, (t/float(samplerate))%60) for t in ax.get_xticks()[:-1]], rotation = 50)