-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatplotlib.html
More file actions
32 lines (30 loc) · 752 Bytes
/
matplotlib.html
File metadata and controls
32 lines (30 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>implementing matplotlib </title>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
<py-env>
- pandas
- numpy
- matplotlib
</py-env>
</head>
<body>
<h1> my plot</h1>
<div id=" plot"></div>
<py-script>
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
x = np.arange(0, 3 * np.pi, 0.1)
y = np.cos(x)
fig,ax = plt.subplots()
ax.plot(x,y)
ax.set(xlabel ='time(s)',ylabel = 'volt (mV)',title='my plot')
ax.grid()
fig
</py-script>
</body>
</html>