Created
November 26, 2022 16:21
-
-
Save veekaybee/f24317fe75283a1b49cecf08ba4ee9fb to your computer and use it in GitHub Desktop.
Testing out Pyscript
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Some plotting</title> | |
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" /> | |
<script defer src="https://pyscript.net/alpha/pyscript.js"></script> | |
<py-env> | |
- matplotlib | |
</py-env> | |
</head> | |
<body> | |
<div id="matplotlib-lineplot"></div> | |
<py-script output="matplotlib-lineplot"> | |
import matplotlib.pyplot as plt | |
fig, ax = plt.subplots() | |
# x axis | |
x = ["Python", "Scala", "Java", "Assembly"] | |
# y axis | |
y = [10, 5, 9, 12] | |
plt.plot(x, y, marker='o', linestyle='-', color='b') | |
plt.xlabel('Language') | |
plt.ylabel('Score') | |
plt.title('Language versus Vibe') | |
fig | |
</py-script> | |
</body> | |
</html> |
Author
veekaybee
commented
Nov 26, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment