Wednesday 5 December 2012

matplotlib plot with latex rendering, pandas store, and rotated axis numbering and spacing


subplot(212); title('Narrowband transducer response.')
x = store['v8_g7e_SPL']; plot(x.index / 1000, x, label=r'$f_{0} = 19.6\,kHz$')
x = store['v8_g7n_SPL']; plot(x.index / 1000, x, label=r'$f_{0} = 19.6\,kHz$')
x = store['v8_g7m_SPL']; plot(x.index / 1000, x, label=r'$f_{0} = 21.5\,kHz$')
plt.setp(plt.xticks()[1], rotation=30)

xlabel(r'$Frequency\ (kHz)$'); ylabel(r'$dB\ SPL, d=10 cm, |V|=1 V$')
dmp = xticks([0, 10, 14.4, 16, 17, 19.6, 20, 21, 21.5],
   [0, 10, r'$f_{a_{min}}=14.4$', r'$f_{e}=16$', r'$f_{a}=17$', r'$f_{0}=19.6$', 20, r'$f_{a_{max}}=21$', r'$f_{0}=21.5$'])
dmp = yticks(arange(60, 115, 5))
xlim(14, 24); ylim(60, 110); legend(loc='best')

subplots_adjust(hspace=0.3)

No comments:

Post a Comment