How do I show mm:ss instead of sample numbers in the following diagram?
I tried:
def formatMS(miliseconds):
return time.strftime('%M:%S', time.gmtime(miliseconds//1000))
fig, ax = plt.subplots()
plt.plot(segtime, segStrength)
labels = [formatMS(t) for t in segtime]
print labels
ax.set_xticklabels(labels)
But now it is showing all 00:00. How do I fix this problem?