summaryrefslogtreecommitdiff
path: root/day1/exercise/four_plot.py
blob: 5417ee55ae9e3116f4a90f652493e040c2bde0e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
x=linspace(-5*pi, 5*pi, 500)
plot(x, x, 'b')
plot(x, -x, 'b')
plot(x, sin(x), 'g', linewidth=2)
plot(x, x*sin(x), 'r', linewidth=3)
legend(['x', '-x', 'sin(x)', 'xsin(x)'])
annotate('origin', xy = (0, 0))
title('Four Plot')
xlim(-5*pi, 5*pi)
ylim(-5*pi, 5*pi)
show()