0
私はプログラミングが初めてで、与えられた2つのリストからポイントの接続プロットを描くように頼んだ質問があります。私のロジックは、私はあなたが他のすべてのとすべての点を結ぶプロットを意味コネクティビティプロットで想定ポイントの接続性プロット
from matplotlib import pyplot as plt
import numpy as np
def Question_3():
x = [0, 0.7, 1, 0.7, 0, -0.7, -1, -0.7]
y = [1, 0.7, 0, -0.7, -1, -0.7, 0, 0.7]
plt.subplot(121)
plt.title("Scatter plot of points", fontsize = 16)
plt.plot(x, y, ".k")
plt.show()
plt.subplot(122)
plt.title("Connectivity plot of points", fontsize = 16)
for C1 in zip(x, y):
for C2 in zip(x, y):
plt.plot(C1, C2, "-r")
plt.show()
Question_3()
感謝!!私はそれを試みたが、私は 'plt.plot((x0、y0)、(x1、y1)、" -r ")'を使った。 –