ref: 4f2c28cb07149d6a9fc080ecdcb1a04f66d6011f
parent: e56560363d79fefcf5628909128e485cf4f2a870
author: Paul Brossier <[email protected]>
date: Tue Dec 17 19:42:17 EST 2013
python/demos/: minor plot improvements
--- a/python/demos/demo_mel-energy.py
+++ b/python/demos/demo_mel-energy.py
@@ -61,8 +61,9 @@
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)
ax.axis(xmax = all_desc_times[-1], xmin = all_desc_times[0])
- ax.annotate('band %d' % i, xy=(-10, 10), xycoords='axes points',
+ ax.annotate('band %d' % i, xy=(-10, 0), xycoords='axes points',
horizontalalignment='right', verticalalignment='bottom',
+ size = 'xx-small',
)
set_xlabels_sample2time( ax, all_desc_times[-1], samplerate)
#plt.ylabel('spectral descriptor value')
--- a/python/demos/demo_pitch.py
+++ b/python/demos/demo_pitch.py
@@ -56,9 +56,11 @@
times = [t * hop_s for t in range(len(pitches))]
fig = plt.figure()
+
ax1 = fig.add_subplot(311)
ax1 = get_waveform_plot(filename, samplerate = samplerate, block_size = hop_s, ax = ax1)
-ax1.set_xticklabels([])
+plt.setp(ax1.get_xticklabels(), visible = False)
+ax1.set_xlabel('')
def array_from_text_file(filename, dtype = 'float'):
import os.path
@@ -87,7 +89,8 @@
ax2.plot(times, cleaned_pitches, '.-')
#ax2.axis( ymin = 0.9 * cleaned_pitches.min(), ymax = 1.1 * cleaned_pitches.max() )
#ax2.axis( ymin = 55, ymax = 70 )
-ax2.set_xticklabels([])
+plt.setp(ax2.get_xticklabels(), visible = False)
+ax2.set_ylabel('f0 (Hz)')
# plot confidence
ax3 = fig.add_subplot(313, sharex = ax1)
@@ -96,6 +99,7 @@
# draw a line at tolerance
ax3.plot(times, [tolerance]*len(confidences))
ax3.axis( xmin = times[0], xmax = times[-1])
-plt.show()
+ax3.set_ylabel('condidence')
set_xlabels_sample2time(ax3, times[-1], samplerate)
-#plt.savefig(os.path.basename(filename) + '.png', dpi=200)
+plt.show()
+#plt.savefig(os.path.basename(filename) + '.svg')
--- a/python/demos/demo_specdesc.py
+++ b/python/demos/demo_specdesc.py
@@ -71,7 +71,7 @@
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)
ax.axis(xmax = all_desc_times[-1], xmin = all_desc_times[0])
- ax.annotate(method, xy=(-10, 10), xycoords='axes points',
+ ax.annotate(method, xy=(-10, 0), xycoords='axes points',
horizontalalignment='right', verticalalignment='bottom',
)
set_xlabels_sample2time(ax, all_desc_times[-1], samplerate)