Skip to content

Commit eaf8828

Browse files
author
Rajesh Kumble Nayak
committed
Added the file
1 parent 9b595bf commit eaf8828

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

simple_plot.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import numpy as np
2+
import matplotlib.pyplot as plt
3+
## www.iiserkol.ac.in/~rajesh/my_python.html
4+
N=100
5+
x=np.linspace(-2*np.pi,2*np.pi, N)
6+
y1= np.sin(x)
7+
y2= np.cos(x)
8+
y=y1*y1+y2*y2
9+
plt.plot(x, y1, 'C0-', label='sin(x)')
10+
plt.plot(x, y2, 'C1-', label='cos(x)')
11+
plt.plot(x, y, 'C2--', linewidth=3, label='sin^2(x)+cos^2(x)')
12+
plt.xlabel('Angle [Radian]')
13+
plt.ylabel('F(x)')
14+
plt.title('Plot of Trignometric Functions')
15+
plt.legend()
16+
plt.ylim([-1.2, 1.2])
17+
plt.grid(alpha=0.3)
18+
plt.show()
19+

0 commit comments

Comments
 (0)