In [1]:
import numpy as np
import pandas as pd
from numpy.random import randn

In [2]:
from scipy import stats

In [3]:
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns

In [4]:
%matplotlib inline

In [5]:
dataset1 = randn(100)

In [6]:
plt.hist(dataset1)


Out[6]:
(array([  5.,  15.,   5.,  21.,  17.,  16.,  17.,   2.,   1.,   1.]),
 array([-2.22393716, -1.70537836, -1.18681955, -0.66826075, -0.14970194,
         0.36885686,  0.88741566,  1.40597447,  1.92453327,  2.44309208,
         2.96165088]),
 <a list of 10 Patch objects>)

In [7]:
dataset1


Out[7]:
array([ 1.34314414, -1.27020399, -1.85235306, -0.52148099,  0.44198118,
       -0.45553371, -2.22393716,  0.81428051,  0.07073892, -0.07026286,
        1.18919538, -0.34306953, -1.60199486, -0.12898068, -1.38826473,
       -0.25941213, -0.22560934,  0.89361693,  1.11282808, -1.32671793,
       -1.8221379 , -0.06757664,  0.6964994 , -1.38706125,  0.87387473,
        0.06608527, -0.35889233,  1.21267256, -1.62920304,  1.22115779,
       -0.52324855,  0.28254007,  0.30119561,  1.61863057, -0.38466879,
        0.557884  , -0.21633517, -1.19088014, -1.22503705,  0.87988844,
        0.70164787,  0.59436183,  0.58792478, -1.48658962, -1.5674875 ,
       -0.10736551,  1.15354286, -0.24841691, -0.88960343,  0.94713182,
       -0.2114833 , -1.43222822, -0.02863137, -1.36773286,  0.84432999,
       -0.03705835,  0.09186827, -0.51894407,  0.42989045,  0.56666126,
        1.31312331, -0.19274962, -0.80830576, -0.10854906,  1.19904585,
       -0.50366732,  0.99462602, -1.42679675,  1.42582915,  0.73224868,
        0.56535775,  0.26231208, -1.19942298,  0.57086855, -1.12686253,
        2.96165088, -0.351979  , -0.18408131, -1.76800038,  0.25100055,
       -1.71737099,  0.96657401,  0.58075434, -0.53933282, -0.98737708,
       -0.39877209,  0.26320186, -1.05813277, -0.55006469,  1.1465455 ,
        1.11962774,  0.2221804 , -1.37618379, -0.03408055,  1.9351627 ,
        1.32207824,  1.30017516, -0.61275662,  1.29451353, -0.16205964])

In [9]:
dataset2 = randn(80)

plt.hist(dataset2, color='indianred')


Out[9]:
(array([  2.,   0.,   1.,   4.,   9.,  21.,  16.,  16.,   9.,   2.]),
 array([-3.48599159, -2.93135989, -2.37672818, -1.82209648, -1.26746477,
        -0.71283306, -0.15820136,  0.39643035,  0.95106205,  1.50569376,
         2.06032546]),
 <a list of 10 Patch objects>)

In [10]:
plt.hist(dataset1, normed=True, color='indianred', alpha=.5, bins = 20)
plt.hist(dataset2, normed=True, alpha=.5, bins=20)


Out[10]:
(array([ 0.09014991,  0.        ,  0.        ,  0.        ,  0.        ,
         0.04507496,  0.04507496,  0.13522487,  0.18029983,  0.22537478,
         0.45074957,  0.49582452,  0.27044974,  0.45074957,  0.58597443,
         0.13522487,  0.27044974,  0.13522487,  0.        ,  0.09014991]),
 array([-3.48599159, -3.20867574, -2.93135989, -2.65404403, -2.37672818,
        -2.09941233, -1.82209648, -1.54478062, -1.26746477, -0.99014892,
        -0.71283306, -0.43551721, -0.15820136,  0.11911449,  0.39643035,
         0.6737462 ,  0.95106205,  1.2283779 ,  1.50569376,  1.78300961,
         2.06032546]),
 <a list of 20 Patch objects>)

In [11]:
data1 = randn(1000)
data2 = randn(1000)

In [12]:
sns.jointplot(data1, data2)


Out[12]:
<seaborn.axisgrid.JointGrid at 0x11ac6ce10>

In [13]:
sns.jointplot(data1, data2, kind='hex')


Out[13]:
<seaborn.axisgrid.JointGrid at 0x11b175e90>

In [ ]: