Skip to content

Instantly share code, notes, and snippets.

@veekaybee
Created November 26, 2022 16:21
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veekaybee/f24317fe75283a1b49cecf08ba4ee9fb to your computer and use it in GitHub Desktop.
Save veekaybee/f24317fe75283a1b49cecf08ba4ee9fb to your computer and use it in GitHub Desktop.
Testing out Pyscript
<!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>
@veekaybee
Copy link
Author

Screen Shot 2022-11-26 at 11 19 40 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment