Created
June 2, 2022 08:17
-
-
Save jumpingchu/05d8a5e7045859a400ed96429f25c1a5 to your computer and use it in GitHub Desktop.
PyScript demo files
This file contains 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 | |
- paths: | |
- ./data.py | |
</py-env> | |
</head> | |
<body> | |
<h1>Let's plot random numbers</h1> | |
<div id="plot"></div> | |
<py-script output="plot"> | |
import matplotlib.pyplot as plt | |
from data import make_x_and_y | |
x, y = make_x_and_y(n=1000) | |
fig, ax = plt.subplots() | |
ax.scatter(x, y) | |
fig | |
</py-script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment