In [3]:
%matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
plt.rcParams['figure.figsize'] = (20.0, 10.0)
plt.rcParams['font.family'] = "serif"

In [1]:
def make_gaussian2d(dimx=1, dimy=1, sigma=1, Xcenter=None, Ycenter=None):
    if Xcenter is None:
        Xcenter = dimx // 2
    if Ycenter is None:
        Ycenter = dimy // 2
    xx, yy = np.meshgrid(np.arange(dimx)-Xcenter,
                         np.arange(dimy)-Ycenter)
    return np.exp(-(((xx)**2 + (yy)**2)/(2*sigma*sigma)))

In [2]:
plt.rcParams['axes.grid'] = False
img = make_gaussian2d(dimx=128, dimy=128, sigma=15, Xcenter=45, Ycenter=55)
img = img + 0.1*np.random.rand(*img.shape)
plt.figure()
plt.imshow(img,cmap='inferno',interpolation='bilinear')


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-2-223d45f06653> in <module>()
----> 1 plt.rcParams['axes.grid'] = False
      2 img = make_gaussian2d(dimx=128, dimy=128, sigma=15, Xcenter=45, Ycenter=55)
      3 img = img + 0.1*np.random.rand(*img.shape)
      4 plt.figure()
      5 plt.imshow(img,cmap='inferno',interpolation='bilinear')

NameError: name 'plt' is not defined

In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [5]:
import numpy as np
import pandas as pd
import seaborn as sns
sns.set(style="white")

# Generate a random correlated bivariate dataset
rs = np.random.RandomState(5)
mean = [0, 0]
cov = [(1, .5), (.5, 1)]
x1, x2 = rs.multivariate_normal(mean, cov, 500).T
x1 = pd.Series(x1, name="$X_1$")
x2 = pd.Series(x2, name="$X_2$")

# Show the joint distribution using kernel density estimation
g = sns.jointplot(x1, x2, kind="scatter", size=7, space=0)



In [ ]: