<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Content and Objective
Show use of histograms by sampling height of multiple people and determining histograms with different parametrization
NOTE
Step1:  Parameters
Step2:  Simulation
Step3:  Plotting
<ASSISTANT_TASK:>
Python Code:
# importing
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
# showing figures inline
%matplotlib inline
# plotting options 
font = {'size'   : 20}
plt.rc('font', **font)
plt.rc('text', usetex=True)
matplotlib.rc('figure', figsize=(18, 6) )
Explanation: Content and Objective
Show use of histograms by sampling height of multiple people and determining histograms with different parametrization
NOTE: Results are based on sampling--yet unknown--Gaussian distribution. Nevertheless, the general idea should be comprehensible.
Import
End of explanation
# number of people 
N_people = 500
Explanation: Parameters
End of explanation
# get random samples of gaussian distribution
# Note: Meaning of Gaussian and parameterization will not be introduced until ch. 5
heights = 172.66 + 9.34 * np.random.randn( N_people )
Explanation: Simulation
End of explanation
# plotting
plt.figure()
plt.subplot(221)
plt.hist( heights, bins=5, range=(140,210), density=True )
plt.grid( True )
plt.ylabel('$\hat{P}(h)$')
plt.margins(.1)
plt.title('5 bins')
plt.subplot(222)
plt.hist( heights, bins=20, range=(140,210), density=True )
plt.grid( True )
plt.ylabel('$\hat{P}(h)$')
plt.margins(.1)
plt.title('20 bins')
plt.subplot(223)
plt.hist( heights, bins=50, range=(140,210), density=True )
plt.grid( True )
plt.xlabel('$h$')
plt.ylabel('$\hat{P}(h)$')
plt.margins(.1)
plt.title('50 bins')
plt.subplot(224)
plt.hist( heights, bins=500, range=(140,210), density=True )
plt.grid( True )
plt.xlabel('$h$')
plt.ylabel('$\hat{P}(h)$')
plt.margins(.1)
plt.title('500 bins')
plt.tight_layout()
Explanation: Plotting
End of explanation
<END_TASK>