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