Skip to content

Commit cfc82e4

Browse files
authored
Added plotting demo using matplotlib package
1 parent d748cc5 commit cfc82e4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

plotting.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import matplotlib.pyplot as plt
2+
import numpy as np
3+
4+
# Create sample data for plotting. Eg: sine wave
5+
t = np.arange(0.0, 2.0, 0.01)
6+
s = 1 + np.sin(2 * np.pi * t)
7+
8+
# Create figure and axes for plotting
9+
fig, ax = plt.subplots()
10+
ax.plot(t, s)
11+
12+
# Include axis info and title
13+
ax.set(xlabel='time (s)', ylabel='Sine value', title='This is a sample sine wave plot')
14+
ax.grid()
15+
16+
# Display the plot
17+
plt.show()

0 commit comments

Comments
 (0)