sorry if this is a stupid question, but I can't find the solution for my problem. I have some points I want to plot and each of this points correspond to one variable. My question is: How can I plot each point in the same plot with unique color each and plot a legend.
This is the code I have so far:
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
function=['a', 'b', 'c', 'd', 'e']
acc_scores = [0.879, 0.748, 0.984, 0.944, 0.940]
fig, ax = plt.subplots()
colors= ['b', 'r', 'g', 'c', 'y'] #Colors I wanted to use for each data point
plt.plot([1,2,3,4,5], acc_scores, 'ro')
plt.axis([0, 6, 0.5, 1])
ax.set_xlabel('Functions', size=18)
ax.set_ylabel('Accuracy', size=18)
plt.show()
This code gives me the points, but all the same color.
Thanks for your help!