I have a 2-D array and I need to plot columns x and y but only within a certain range of x. I know how to plot using the index but I need to specify the value of x. I have a few of those arrays so I am trying to find a way to do that without having to look at each one of them individually.
Here is an example:
array([[ 4.40148390e+03, 1.13200000e+00],
[ 4.40248390e+03, 1.12200000e+00],
[ 4.40348440e+03, 1.11600000e+00],
[ 4.40448440e+03, 1.10600000e+00],
[ 4.40548490e+03, 1.09200000e+00],
[ 4.40648490e+03, 1.07700000e+00],
[ 4.40748540e+03, 1.08700000e+00],
[ 4.40848540e+03, 1.09400000e+00],
[ 4.40948580e+03, 1.10200000e+00],
[ 4.41048580e+03, 1.09500000e+00],
[ 4.41148630e+03, 1.12000000e+00]])
So let's say I only need 4402 < x < 4410 but I don't know the index. Can I put something like: plot(x, y, where(4402 < x < 4410))?
I feel like there is something obvious that I am missing here :p
a[(a[:,0]>4402)&(a[:,0]<4410)]