12.3.10.6. BivariateΒΆ

demo bivariate

Out:

C:\itom_vs2017_x64_Qt5.12.6_setup4.0\3rdParty\Python\lib\site-packages\seaborn\cm.py:1582: UserWarning:

Trying to register the cmap 'rocket' which already exists.

C:\itom_vs2017_x64_Qt5.12.6_setup4.0\3rdParty\Python\lib\site-packages\seaborn\cm.py:1583: UserWarning:

Trying to register the cmap 'rocket_r' which already exists.

C:\itom_vs2017_x64_Qt5.12.6_setup4.0\3rdParty\Python\lib\site-packages\seaborn\cm.py:1582: UserWarning:

Trying to register the cmap 'mako' which already exists.

C:\itom_vs2017_x64_Qt5.12.6_setup4.0\3rdParty\Python\lib\site-packages\seaborn\cm.py:1583: UserWarning:

Trying to register the cmap 'mako_r' which already exists.

C:\itom_vs2017_x64_Qt5.12.6_setup4.0\3rdParty\Python\lib\site-packages\seaborn\cm.py:1582: UserWarning:

Trying to register the cmap 'icefire' which already exists.

C:\itom_vs2017_x64_Qt5.12.6_setup4.0\3rdParty\Python\lib\site-packages\seaborn\cm.py:1583: UserWarning:

Trying to register the cmap 'icefire_r' which already exists.

C:\itom_vs2017_x64_Qt5.12.6_setup4.0\3rdParty\Python\lib\site-packages\seaborn\cm.py:1582: UserWarning:

Trying to register the cmap 'vlag' which already exists.

C:\itom_vs2017_x64_Qt5.12.6_setup4.0\3rdParty\Python\lib\site-packages\seaborn\cm.py:1583: UserWarning:

Trying to register the cmap 'vlag_r' which already exists.

C:\itom_vs2017_x64_Qt5.12.6_setup4.0\3rdParty\Python\lib\site-packages\seaborn\cm.py:1582: UserWarning:

Trying to register the cmap 'flare' which already exists.

C:\itom_vs2017_x64_Qt5.12.6_setup4.0\3rdParty\Python\lib\site-packages\seaborn\cm.py:1583: UserWarning:

Trying to register the cmap 'flare_r' which already exists.

C:\itom_vs2017_x64_Qt5.12.6_setup4.0\3rdParty\Python\lib\site-packages\seaborn\cm.py:1582: UserWarning:

Trying to register the cmap 'crest' which already exists.

C:\itom_vs2017_x64_Qt5.12.6_setup4.0\3rdParty\Python\lib\site-packages\seaborn\cm.py:1583: UserWarning:

Trying to register the cmap 'crest_r' which already exists.


<AxesSubplot:>

import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
sns.set_theme(style="dark")

# Simulate data from a bivariate Gaussian
n = 10000
mean = [0, 0]
cov = [(2, .4), (.4, .2)]
rng = np.random.RandomState(0)
x, y = rng.multivariate_normal(mean, cov, n).T

# Draw a combo histogram and scatterplot with density contours
f, ax = plt.subplots(figsize=(6, 6))
sns.scatterplot(x=x, y=y, s=5, color=".15")
sns.histplot(x=x, y=y, bins=50, pthresh=.1, cmap="mako")
sns.kdeplot(x=x, y=y, levels=5, color="w", linewidths=1)

Total running time of the script: ( 0 minutes 9.172 seconds)

Gallery generated by Sphinx-Gallery