import matplotlib.pyplot as plt x = [[1, 3], [2, 5]] # [1,3]是線段1兩端點的x坐標 y = [[4, 7], [6, 3]] # [1,3]是線段1兩端點的y坐標 plt.figure() # 創建繪制窗口 for i in range(len(x)): plt.plot(x[i], y[i], color='r') plt.scatter(x[i], y[i], color='b') plt.show()
import matplotlib.pyplot as plt x = [[1, 3], [2, 5]] # [1,3]是線段1兩端點的x坐標 y = [[4, 7], [6, 3]] # [1,3]是線段1兩端點的y坐標 plt.figure() # 創建繪制窗口 for i in range(len(x)): plt.plot(x[i], y[i], color='r') plt.scatter(x[i], y[i], color='b') plt.show()
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。