Click here to Skip to main content
15,880,503 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
ı need make a loop from data coordinates for graph, for example ı want to change the plot's color in graph one by one and starts again from the firs one.I'll be glad if you can help me.

What I have tried:

Python
import numpy as np
from matplotlib import pyplot as plt

data = np.array([
    [5, 7],
    [6, 3],
    [9, 4],
])
x, y = data.T
list =data.tolist()
for x,y in list:
  plt.scatter(x,y,color='red')
  plt.show()
Posted
Updated 28-Jul-20 23:36pm
v2
Comments
Richard MacCutchan 29-Jul-20 3:58am    
Where is the code that sets the visualisation and the colours?
bswarrior 29-Jul-20 5:39am    
I reconfigured my question, if you can look again ı'll be appreciate.
Richard MacCutchan 29-Jul-20 5:46am    
Just add a second loop with different parameters.
for y,x in list:
  plt.scatter(x,y,color='blue')
  plt.show()

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900