python畫線段


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刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM