반응형

출처: http://stackoverflow.com/questions/1985856/how-to-make-a-3d-scatter-plot-in-python

 

import matplotlib.pyplot as plt
import pylab
from mpl_toolkits.mplot3d import Axes3D


fig = pylab.figure()
ax = Axes3D(fig)


qid = grouped.query('(user_number == 123)')
x = qid['loc_x'].tolist()
y = qid['loc_y'].tolist()
xy = np.vstack([x,y])
z = gaussian_kde(xy)(xy)


ax.scatter(x, y, z)
plt.show() 

 

-  gaussian_kde를 이용해서 z 축은 확률밀도 값으로 출력 

반응형

+ Recent posts