Reputation: 103
I have defined an array that contains 1000 points, to illustrate, something like this:
x = np.zeros([1000, 2])
for i in range(1001):
x = 'int + [i , i] / 2'
How do I plot the points with plt.scatter()? I have tried with just inserting x, but it doent work. Thank you in advance!
Upvotes: 0
Views: 50
Reputation: 3260
I think you're trying to do something like this:
import matplotlib.pyplot as plt
x = np.zeros([1000, 2])
for i in range(len(x)):
x[i] = [i/2 , i/2]
plt.scatter(x[:,0],x[:,1])
plt.show()
If anything isn't clear, don't hesitate to ask!
Upvotes: 1