I have an array containing 2 data curves, imported from excel. Below is my array. Column 1 is the x axis, while column 3 is the y axis.
[[ 0.00000000e+00 8.57250668e-06 0.00000000e+00]
[ 1.88000000e+03 8.57250668e-06 1.88617039e-01]
[ 8.01000000e+03 8.57250668e-06 3.42702439e-01]
[ 8.16300000e+04 8.57250668e-06 4.43486869e-01]
[ 0.00000000e+00 1.49761692e-05 0.00000000e+00]
[ 2.09000000e+03 1.49761692e-05 1.58760000e-01]
[ 8.22000000e+03 1.49761692e-05 2.54700000e-01]
[ 8.18400000e+04 1.49761692e-05 2.92848750e-01]]
Here is my code
import numpy as np
import matplotlib.pyplot as plt
A = np.array(
[[0.00000000e+00, 8.57250668e-06, 0.00000000e+00],
[1.88000000e+03, 8.57250668e-06, 1.88617039e-01],
[8.01000000e+03, 8.57250668e-06, 3.42702439e-01],
[8.16300000e+04, 8.57250668e-06, 4.43486869e-01],
[0.00000000e+00, 1.49761692e-05, 0.00000000e+00],
[2.09000000e+03, 1.49761692e-05, 1.58760000e-01],
[8.22000000e+03, 1.49761692e-05, 2.54700000e-01],
[8.18400000e+04, 1.49761692e-05, 2.92848750e-01]])
print A
x= A[:,0]
c0= A[:,1]
y_meas= A[:,2]
plt.plot(x,y_meas,'-b')
plt.title('Reaction')
plt.legend(['Data'], loc='lower right')
plt.show()
Obviously this is not what I want. How do I keep the 2 curves within the array separately, such that I can have 2 discrete curves?
plot()
command plots points according to their order in the array. Perhaps you want to sort the array first? – Bitwise Jan 19 at 19:29