Created
May 1, 2022 19:02
-
-
Save erykml/bc20f3dee89d147658a60651e5229e40 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" /> | |
| <script defer src="https://pyscript.net/alpha/pyscript.js"></script> | |
| <py-env> | |
| - numpy | |
| - matplotlib | |
| </py-env> | |
| </head> | |
| <body> | |
| <h1>Plotting a histogram of Standard Normal distribution</h1> | |
| <div id="plot"></div> | |
| <py-script output="plot"> | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| np.random.seed(42) | |
| rv = np.random.standard_normal(1000) | |
| fig, ax = plt.subplots() | |
| ax.hist(rv, bins=30) | |
| fig | |
| </py-script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment