Changeset 45fcbb8 for python/aubio/task
- Timestamp:
- May 4, 2006, 5:02:33 PM (19 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/aubio/task/onset.py
rfb8bde7 r45fcbb8 118 118 wplot.append(Gnuplot.Data(x1,y1p,with='impulses')) 119 119 120 oplots.append( oplot)120 oplots.append((oplot,self.params.onsetmode,self.maxofunc)) 121 121 122 122 # check if ground truth datafile exists … … 146 146 time,data = audio_to_array(self.input) 147 147 wplot = [make_audio_plot(time,data)] + wplot 148 self.title = self.input149 148 # prepare the plot 150 149 g = gnuplot_init(outplot) … … 153 152 154 153 # hack to align left axis 155 g('set lmargin 6') 154 g('set lmargin 3') 155 g('set rmargin 6') 156 156 g('set tmargin 0') 157 157 g('set format x ""') 158 g('set format y " "')158 g('set format y "%3e"') 159 159 g('set noytics') 160 160 … … 162 162 # plot onset detection functions 163 163 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)))) 165 165 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]) 167 173 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)) 170 176 g('set format x "%1.1f"') 177 g('set format y "%1f"') 178 g('set y2tics -1,1') 179 171 180 172 181 g('set title \'%s %s\'' % (re.sub('.*/','',self.input),self.title))
Note: See TracChangeset
for help on using the changeset viewer.