Plotting specific range of values within an array Pyplot


Question

I want to plot a certain range of values within 2 arrays using matplotlib,

seconds = 200
dt = .001
x = array of values
time = arange(0, seconds, dt)

Goal is to plot everything after the first 25 seconds. I Know I could create 2 new arrays using a for loop, but I'm certain there's some simple built in function for such things.

Thanks in advance

1
1
11/30/2012 1:55:14 AM

Accepted Answer

Solved. writing

time[a:b]

will give you an array of all the values between time[a] and time[b].

3
11/30/2012 4:25:06 AM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon