In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import zsplot
In [6]:
n_gaussians = 10
n_points = 1000
x = np.zeros(n_gaussians*n_points)
y = np.zeros(n_gaussians*n_points)
for i in range(n_gaussians):
xcenter = np.random.uniform(0,10)
ycenter = np.random.uniform(0,10)
xwidth = np.random.rand()
ywidth = np.random.rand()
x_sample = np.random.normal(loc=xcenter, scale=xwidth, size=n_points)
y_sample = np.random.normal(loc=ycenter, scale=ywidth, size=n_points)
x[i*n_points:(i+1)*n_points] = x_sample
y[i*n_points:(i+1)*n_points] = y_sample
In [8]:
fig, axes = zsplot.kde2d(x,y, markersize=2)