Changeset 45fcbb8


Ignore:
Timestamp:
May 4, 2006, 5:02:33 PM (18 years ago)
Author:
Paul Brossier <piem@altern.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
3e29681
Parents:
fb8bde7
Message:

update onset plot
update onset plot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/aubio/task/onset.py

    rfb8bde7 r45fcbb8  
    118118                                wplot.append(Gnuplot.Data(x1,y1p,with='impulses'))
    119119
    120                 oplots.append(oplot)
     120                oplots.append((oplot,self.params.onsetmode,self.maxofunc))
    121121
    122122                # check if ground truth datafile exists
     
    146146                time,data = audio_to_array(self.input)
    147147                wplot = [make_audio_plot(time,data)] + wplot
    148                 self.title = self.input
    149148                # prepare the plot
    150149                g = gnuplot_init(outplot)
     
    153152
    154153                # hack to align left axis
    155                 g('set lmargin 6')
     154                g('set lmargin 3')
     155                g('set rmargin 6')
    156156                g('set tmargin 0')
    157157                g('set format x ""')
    158                 g('set format y ""')
     158                g('set format y "%3e"')
    159159                g('set noytics')
    160160
     
    162162                        # plot onset detection functions
    163163                        g('set size 1,%f' % (0.7/(len(oplots))))
    164                         g('set origin 0,%f' % (float(i)*0.7/(len(oplots))))
     164                        g('set origin 0,%f' % ((len(oplots)-float(i)-1)*0.7/(len(oplots))))
    165165                        g('set xrange [0:%f]' % (self.lenofunc*self.params.step))
    166                         g.plot(*oplots[i])
     166                        g('set nokey')
     167                        g('set yrange [0:%f]' % (1.1*oplots[i][2]))
     168                        g('set y2tics ("0" 0, "%d" %d)' % (round(oplots[i][2]),round(oplots[i][2])))
     169                        g.ylabel(oplots[i][1])
     170                        if i == len(oplots)-1:
     171                                g.xlabel('time (s)',offset=(0,0.7))
     172                        g.plot(*oplots[i][0])
    167173
    168                 g('set tmargin 3.0')
    169                 g('set xlabel "time (s)" 1,0')
     174                g('set tmargin 2')
     175                g.xlabel('time (s)',offset=(0,0.7))
    170176                g('set format x "%1.1f"')
     177                g('set format y "%1f"')
     178                g('set y2tics -1,1')
     179
    171180
    172181                g('set title \'%s %s\'' % (re.sub('.*/','',self.input),self.title))
Note: See TracChangeset for help on using the changeset viewer.