내용

글번호 948
작성자 허진경
작성일 2019-02-08 17:43:59
제목 3D PCA 설명을 위한 산점도 그림 코드
내용 %matplotlib inline from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np np.random.seed(4) fig = plt.figure(figsize=(8,5)) ax = fig.add_subplot(111, projection='3d') n = 300 xs = np.random.normal(50, 5, n) ys = np.random.normal(50, 10, n) zs = np.random.normal(50, 20, n) ax.scatter(xs, ys, zs, c='r', marker='+') ax.set_xlabel('X') ax.set_ylabel('Y') ax.set_zlabel('Z') plt.show()