내용 |
%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() |