shithub: aubio

Download patch

ref: bf8e1344a4dc8e764f1a86e4a833fcce0142a65b
parent: 470a772cc0cefecbd33f4144706397eb5b770421
author: Paul Brossier <piem@altern.org>
date: Thu Jul 13 09:49:32 EDT 2006

add xsize and ysize plot options in aubiopitch
add xsize and ysize plot options in aubiopitch


--- a/python/aubiopitch
+++ b/python/aubiopitch
@@ -60,6 +60,12 @@
   parser.add_option("-p","--plot",
       action="store_true", dest="plot", default=False, 
       help="draw plot of the pitch track")
+  parser.add_option("-x","--xsize",
+      action="store", dest="xsize", default=1., 
+      type='float', help="define xsize for plot")
+  parser.add_option("-y","--ysize",
+      action="store", dest="ysize", default=1., 
+      type='float', help="define ysize for plot")
   parser.add_option("-O","--outplot",
       action="store", dest="outplot", default=None, 
       help="save the plot to output.{ps,png,svg} instead of displaying it")
@@ -116,5 +122,11 @@
 	#print filetask.eval(pitch[i]) 
 	if options.plot: filetask.plot(pitch,wplot,oplots,titles)
 
+if options.outplot:
+  extension = options.outplot.split('.')[-1] 
+  outplot = '.'.join(options.outplot.split('.')[:-1])
+else:
+  extension,outplot = None,None
 if options.plot: 
-	filetask.plotplot(wplot,oplots,titles,outplot=options.outplot,truth=options.plottruth)
+	filetask.plotplot(wplot,oplots,titles,outplot=outplot,extension=extension,
+  xsize=options.xsize,ysize=options.ysize,truth=options.plottruth)