Reputation: 21
I've looked for various solutions to my problem but can't get any help. I'm creating a sine wave and cutting it up into buffers. Ie cutting it into parts. The program seems to run this fine but all the sections start from 0 opposed to the desired start point.
Code:
slice= 2048
arr2= arr1[:slice] # 1st buffer from 0-2048
arr3= arr1[slice:2*slice] #2nd buffer from 2048-4096
pylab.plot(arr2)
pylab.draw()
pylab.figure()
pylab.plot(arr3)
pylab.show()
This prints the correct looking graphs for both parts but the 2nd graph starts at 0 (opposed to the range 2048-4096) I'm using the pylab.plot function- can anyone help?
Upvotes: 2
Views: 86
Reputation: 924
In your plot()
function you need to specify the X axis:
pylab.plot(range(0,2048),arr2)
pylab.draw()
pylab.figure()
pylab.plot(range(2048,4096),arr3)
pylab.show()
Upvotes: 1