History

update onset plot update onset plot

Paul Brossier committed 20 years ago

Commit 45fcbb81 parent fb8bde71 file · +18 −9Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/aubio/task/onset.py+18−9
@@ -117,7 +117,7 @@ class taskonset(task): · 116 unmodified lines
117117 oplot.append(Gnuplot.Data(x1,y1,with='impulses'))
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
123123 datafile = self.input.replace('.wav','.txt')
@@ -145,29 +145,38 @@ class taskonset(task): · 21 unmodified lines
145145 # audio data
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)
151150
152151 g('set multiplot')
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
161161 for i in range(len(oplots)):
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])
167−
168− g('set tmargin 3.0')
169− g('set xlabel "time (s)" 1,0')
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])
173+
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))
173182

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t