python/aubio: use Gnuplot.Data with_ keywords, with is a reserved keyword in python...
authorPaul Brossier <piem@piem.org>
Fri, 25 Sep 2009 23:42:52 +0000 (01:42 +0200)
committerPaul Brossier <piem@piem.org>
Fri, 25 Sep 2009 23:42:52 +0000 (01:42 +0200)
python/aubio/bench/onset.py
python/aubio/plot/notes.py
python/aubio/task/beat.py
python/aubio/task/notes.py
python/aubio/task/onset.py
python/aubio/task/pitch.py
python/aubioplot-yinfft

index f9fbe23d38b1ad9b202e05c1ca175ec3f32f398d..978986ccc56d2470586bb11e37399a7ae348e9fe 100644 (file)
@@ -111,7 +111,7 @@ class benchonset(bench):
                for i in self.vlist:
                        gd.append(i['GD']) 
                        fp.append(i['FP']) 
-               d.append(Gnuplot.Data(fp, gd, with='linespoints', 
+               d.append(Gnuplot.Data(fp, gd, with_='linespoints', 
                        title="%s %s" % (plottitle,i['mode']) ))
 
        def plotplotroc(self,d,outplot=0,extension='ps'):
@@ -147,7 +147,7 @@ class benchonset(bench):
                for i in self.vlist:
                        x.append(i['prec']) 
                        y.append(i['recl']) 
-               d.append(Gnuplot.Data(x, y, with='linespoints', 
+               d.append(Gnuplot.Data(x, y, with_='linespoints', 
                        title="%s %s" % (plottitle,i['mode']) ))
 
        def plotplotpr(self,d,outplot=0,extension='ps'):
@@ -172,7 +172,7 @@ class benchonset(bench):
                for i in self.vlist:
                        x.append(i['thres']) 
                        y.append(i['dist']) 
-               d.append(Gnuplot.Data(x, y, with='linespoints', 
+               d.append(Gnuplot.Data(x, y, with_='linespoints', 
                        title="%s %s" % (plottitle,i['mode']) ))
 
        def plotplotfmeas(self,d,outplot="",extension='ps', title="F-measure"):
@@ -205,7 +205,7 @@ class benchonset(bench):
                for i in self.vlist:
                        x.append(i[var]) 
                        y.append(i['dist']) 
-               d.append(Gnuplot.Data(x, y, with='linespoints', 
+               d.append(Gnuplot.Data(x, y, with_='linespoints', 
                        title="%s %s" % (plottitle,i['mode']) ))
        
        def plotplotfmeasvar(self,d,var,outplot="",extension='ps', title="F-measure"):
@@ -244,7 +244,7 @@ class benchonset(bench):
                total = v['Torig']
                for i in range(len(per)): per[i] /= total/100.
 
-               d.append(Gnuplot.Data(val, per, with='fsteps', 
+               d.append(Gnuplot.Data(val, per, with_='fsteps', 
                        title="%s %s" % (plottitle,v['mode']) ))
                #d.append('mean=%f,sigma=%f,eps(x) title \"\"'% (mean,smean))
                #d.append('mean=%f,sigma=%f,eps(x) title \"\"'% (amean,samean))
@@ -275,7 +275,7 @@ class benchonset(bench):
                total = v['Torig']
                for i in range(len(per)): per[i] /= total/100.
 
-               d.append(Gnuplot.Data(val, per, with='fsteps', 
+               d.append(Gnuplot.Data(val, per, with_='fsteps', 
                        title="%s %s" % (plottitle,v['mode']) ))
                #d.append('mean=%f,sigma=%f,eps(x) title \"\"'% (mean,smean))
                #d.append('mean=%f,sigma=%f,eps(x) title \"\"'% (amean,samean))
index a15d3ff221a89faf5bd1f958536140e0388a277a..f76d2cf62086b0b9a50bed54b2f5221a000a33e4 100644 (file)
@@ -51,7 +51,7 @@ def plotnote_withends(la,plot_title=None) :
                la[:,2],                        # y centers
                x_widths,                       # x errors
                __notesheight*ones(len(la)),    # y errors
-               title=plot_title,with=('boxxyerrorbars fs 3')))
+               title=plot_title,with_=('boxxyerrorbars fs 3')))
        return d
 
 
@@ -66,7 +66,7 @@ def plotnote_withoutends(la,plot_title=None) :
                 la[:-1,1],                      # y centers
                 x_widths,                       # x errors
                 __notesheight*ones(len(la)-1),  # y errors
-                title=plot_title,with=('boxxyerrorbars fs 3')))
+                title=plot_title,with_=('boxxyerrorbars fs 3')))
         return d
 
 def plotnote_do(d,fileout=None):
index cc252504117e45e3064dadb3ef6b233013cf00a8..b1d9e495caac97bc7ce96bc1654498f72477bbf2 100644 (file)
@@ -247,7 +247,7 @@ class taskbeat(taskonset):
 
        def plot(self,oplots,results):
                import Gnuplot
-               oplots.append(Gnuplot.Data(results,with='linespoints',title="auto"))
+               oplots.append(Gnuplot.Data(results,with_='linespoints',title="auto"))
 
        def plotplot(self,wplot,oplots,outplot=None,extension=None,xsize=1.,ysize=1.,spectro=False):
                import Gnuplot
@@ -258,5 +258,5 @@ class taskbeat(taskonset):
                #f = make_audio_plot(time,data)
 
                g = gnuplot_create(outplot=outplot, extension=extension)
-               oplots = [Gnuplot.Data(self.gettruth(),with='linespoints',title="orig")] + oplots
+               oplots = [Gnuplot.Data(self.gettruth(),with_='linespoints',title="orig")] + oplots
                g.plot(*oplots)
index 1efb8dba981d28278e90c7c493400a80f19cab8a..2554c98f978e6078da1b12bd42bf79babf6b94cc 100644 (file)
@@ -94,15 +94,15 @@ class tasknotes(task):
        def plot(self,now,onset,freq,ifreq,oplots):
                import Gnuplot
 
-               oplots.append(Gnuplot.Data(now,freq,with='lines',
+               oplots.append(Gnuplot.Data(now,freq,with_='lines',
                        title=self.params.pitchmode))
-               oplots.append(Gnuplot.Data(now,ifreq,with='lines',
+               oplots.append(Gnuplot.Data(now,ifreq,with_='lines',
                        title=self.params.pitchmode))
 
                temponsets = []
                for i in onset:
                        temponsets.append(i*1000)
-               oplots.append(Gnuplot.Data(now,temponsets,with='impulses',
+               oplots.append(Gnuplot.Data(now,temponsets,with_='impulses',
                        title=self.params.pitchmode))
 
        def plotplot(self,wplot,oplots,outplot=None,multiplot = 0):
@@ -116,10 +116,10 @@ class tasknotes(task):
                # check if ground truth exists
                #timet,pitcht = self.gettruth()
                #if timet and pitcht:
-               #       oplots = [Gnuplot.Data(timet,pitcht,with='lines',
+               #       oplots = [Gnuplot.Data(timet,pitcht,with_='lines',
                #               title='ground truth')] + oplots
 
-               t = Gnuplot.Data(0,0,with='impulses') 
+               t = Gnuplot.Data(0,0,with_='impulses') 
 
                g = gnuplot_init(outplot)
                g('set title \'%s\'' % (re.sub('.*/','',self.input)))
index 8466e2d51600109cb4b8fec7c4c23fff43e4d562..9e8382e268be794f07232b127d88fed434f15a9d 100644 (file)
@@ -92,7 +92,7 @@ class taskonset(task):
                import Gnuplot, Gnuplot.funcutils
                import aubio.txtfile
                import os.path
-    from numpy import arange, array, ones
+               from numpy import arange, array, ones
                from aubio.onsetcompare import onset_roc
 
                x1,y1,y1p = [],[],[]
@@ -103,7 +103,7 @@ class taskonset(task):
                self.maxofunc = max(ofunc)
                # onset detection function 
                downtime = arange(len(ofunc))*self.params.step
-               oplot.append(Gnuplot.Data(downtime,ofunc,with='lines',title=self.params.onsetmode))
+               oplot.append(Gnuplot.Data(downtime,ofunc,with_='lines',title=self.params.onsetmode))
 
                # detected onsets
                if not nplot:
@@ -114,8 +114,8 @@ class taskonset(task):
                        #x1 = array(onsets)*self.params.step
                        #y1 = self.maxofunc*ones(len(onsets))
                        if x1:
-                               oplot.append(Gnuplot.Data(x1,y1,with='impulses'))
-                               wplot.append(Gnuplot.Data(x1,y1p,with='impulses'))
+                               oplot.append(Gnuplot.Data(x1,y1,with_='impulses'))
+                               wplot.append(Gnuplot.Data(x1,y1p,with_='impulses'))
 
                oplots.append((oplot,self.params.onsetmode,self.maxofunc))
 
@@ -128,7 +128,7 @@ class taskonset(task):
                        t_onsets = aubio.txtfile.read_datafile(datafile)
                        x2 = array(t_onsets).resize(len(t_onsets))
                        y2 = self.maxofunc*ones(len(t_onsets))
-                       wplot.append(Gnuplot.Data(x2,y2,with='impulses'))
+                       wplot.append(Gnuplot.Data(x2,y2,with_='impulses'))
                        
                        tol = 0.050 
 
index d8ea1e242f5336ddc80b210927261143981af772..a531a62bacb63911c47d1ef9986167f7e70e92a0 100644 (file)
@@ -156,7 +156,7 @@ class taskpitch(task):
 
                time = [ (i+self.params.pitchdelay)*self.params.step for i in range(len(pitch)) ]
                pitch = [aubio_freqtomidi(i) for i in pitch]
-               oplots.append(Gnuplot.Data(time,pitch,with='lines',
+               oplots.append(Gnuplot.Data(time,pitch,with_='lines',
                        title=self.params.pitchmode))
                titles.append(self.params.pitchmode)
 
@@ -170,7 +170,7 @@ class taskpitch(task):
                if truth:
                        timet,pitcht = self.gettruth()
                        if timet and pitcht:
-                               oplots = [Gnuplot.Data(timet,pitcht,with='lines',
+                               oplots = [Gnuplot.Data(timet,pitcht,with_='lines',
                                        title='ground truth')] + oplots
 
                g = gnuplot_create(outplot=outplot, extension=extension)
index 3aeb455269eb04ab892080efa209c92ab6f7bad7..fcbe0d1be79f7b9665c49d3547714849be8ba5f9 100755 (executable)
@@ -73,10 +73,10 @@ while (taskfile.readsize == params.hopsize):
   y = [yin.get(i,0) for i in range(params.bufsize/2)]
   thresh = [0.1 for i in range(params.bufsize/2)]
   #t.append((i/float(params.hopsize)+taskfile.frameread)*params.step),t.pop(0)
-  d = [plotdata(n,a,plottitle="signal", with='lines'),
-    plotdata(n,c,plottitle="d[t]",axes='x1y2', with='lines lt 1'),
-    plotdata(n,y,plottitle="d'[t]",axes='x1y1', with='lines lt 2'),
-    plotdata(n,thresh,plottitle="threshold",axes='x1y1', with='lines lt 3')]
+  d = [plotdata(n,a,plottitle="signal", with_='lines'),
+    plotdata(n,c,plottitle="d[t]",axes='x1y2', with_='lines lt 1'),
+    plotdata(n,y,plottitle="d'[t]",axes='x1y1', with_='lines lt 2'),
+    plotdata(n,thresh,plottitle="threshold",axes='x1y1', with_='lines lt 3')]
   #g('set xrange [%f:%f]' % (t[0],t[-1]))
   #time.sleep(.2)
   g.reset()