matplotlib では、ループを使用してグラフをプロットします。各ステップでは、特定の色 C[index] を使用して 1 つのデータ ポイント (X[index]、Y[index]) のみをプロットし、それぞれに色を割り当てます。点。全部で 8 色を使用してデータ ポイントを表しているので、これらの 8 色で凡例を作成し、それぞれが 1 つの意味を表していることを願っています。
これは私のコードです。手伝ってくれてありがとう。: )
for index in range(0,len(X)):
plt.plot(X[index],Y1[index], marker = 'o', markersize = 10, color = C[index])
plt.xlabel("the percentage of students' credit hours found in instructor data", fontsize=14, color ="blue")
plt.ylabel("total number of writing assinments", fontsize=14, color="blue")
plt.axis([0, 100, 0, max(Y1)])
plt.show()