shithub: aubio

Download patch

ref: 778bc7a3e1bb9eed9eeb669dbd20c63879283264
parent: e638bcfa611dd8138229acd63793e6edd285fc01
author: Paul Brossier <piem@altern.org>
date: Wed Aug 2 07:23:43 EDT 2006

if spectrum shorter than 1 second, use ms not s
if spectrum shorter than 1 second, use ms not s


--- a/python/aubio/gnuplot.py
+++ b/python/aubio/gnuplot.py
@@ -122,7 +122,11 @@
 	data,time,freq = audio_to_spec(filename,minf=minf,maxf=maxf,bufsize=bufsize,hopsize=hopsize)
 	xorig = 0.
 	if not noaxis:
-		g.xlabel('Time (s)')
+		if max(time) < 1.:
+			time = [t*1000. for t in time]
+			g.xlabel('Time (ms)')
+		else:
+			g.xlabel('Time (s)')
 		g.ylabel('Frequency (Hz)')
 	g('set size %f,%f' % (xsize, ysize))
 	g('set pm3d map')