fork download
  1. # Import required libraries
  2. from scipy.stats import norm
  3. import numpy as np
  4. import matplotlib.pyplot as plt
  5. import seaborn as sb
  6.  
  7. # Creating the distribution
  8. data = np.arange(1, 10, 0.01)
  9. pdf = norm.pdf(data, loc=5.3, scale=1)
  10.  
  11. # Visualizing the distribution
  12. sb.set_style('whitegrid')
  13. sb.lineplot(data, pdf, color='black')
  14. plt.xlabel('Heights') # Corrected the typo in 'plt.xlabe' to 'plt.xlabel'
  15. plt.ylabel('Probability Density') # Corrected the typo in 'plt.ylabel'
  16. plt.show() # Added plt.show() to display the plot
  17.  
  18.  
Success #stdin #stdout #stderr 2.9s 121196KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
/usr/local/lib/python3.9/dist-packages/seaborn/_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
  warnings.warn(