python 3D散點繪圖;


python繪制3D散點圖, 采用matplotlib庫;

包引入:

import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d as p3d
import numpy as np
    fig = plt.figure()
    ax = p3d.Axes3D(fig)          // 這一個非常關鍵;
    np.meshgrid()
    x = list(range(0, grayImg.shape[0]))
    y = list(range(0, grayImg.shape[1]))
    X, Y = np.meshgrid(x, y)       // X,Y;
    z = imgCornor.reshape(grayImg.shape[0] * grayImg.shape[1])
    ax.scatter(X, Y, z, c='b', s=10, alpha=0.05)
    plt.show()

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



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