tarray_1s = np.arange( start_frame, start_frame + frames_read ) barray_2b = ar.array( 'h', ''.join(frames) ) x_ticks = [] while i < frames_read: x_ticks.append( tarray_1s[i] ) i += sampling_rate ax = plt.figure().add_subplot(111) ax.plot( tarray_1s, barray_2b, 'b.' ) ax.set_xlim( start_frame, start_frame+frames_read ) ax.set_xticks( x_ticks ) plt.grid() plt.show()