import numpy as np #import scipy.stats as stats import seaborn as sns # seaborn package를 이용 import matplotlib.pyplot as plt # matplotlib.pyplot package를 이용 from numpy import random # set the random seed: np.random.seed(12345) r=10000 poi1 = random.poisson(3, size=r) sns.histplot(data=poi1, x=None).set(title='Histogram of Poi3') plt.show() poi2 = random.poisson(5.0, size=r) sns.histplot(data=poi2, x=None).set(title='Histogram of Poi5') plt.show() poi3 = random.poisson(10.0, size=r) sns.histplot(data=poi3, x=None).set(title='Histogram of Poi10') plt.show() poi4 = random.poisson(16, size=r) sns.histplot(data=poi4, x=None).set(title='Histogram of Poi16') plt.show() fig = plt.figure(figsize=(14,7)) # 두 개의 그래프를 한 페이지에 그림 fig, axs = plt.subplots(ncols=2) fig, ays = plt.subplots(ncols=2) sns.histplot(data=poi1, x=None, ax=axs[0]).set(title='Histogram of Poisson(mu=3.0 & mu=5.0)') sns.histplot(data=poi2, x=None, ax=axs[1]) fig.subplots_adjust(wspace=0.5) # 우측그림의 좌우 간격을 조정 #plt.savefig('C:/BOOK/PyBasics/PyStat/code/poison-1.png') sns.histplot(data=poi3, x=None, ax=ays[0]).set(title='Histogram of Poisson(mu=10.0 & mu=16.0)') sns.histplot(data=poi4, x=None, ax=ays[1]) fig.subplots_adjust(wspace=0.5) # 우측그림의 좌우 간격을 조정 #plt.savefig('C:/BOOK/PyBasics/PyStat/code/poison-2.png')