summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPuneeth Chaganti2010-05-01 16:30:45 +0530
committerPuneeth Chaganti2010-05-01 16:30:45 +0530
commitce2d44cdfdc92f40f884845df64c457c24d7c8c9 (patch)
tree82ddba32180e727ae9f3dfb05f99ebb2bfdd1e94
parentc80b4a34a947e02193faf92a0e554102874ba8ce (diff)
downloadworkshops-ce2d44cdfdc92f40f884845df64c457c24d7c8c9.tar.gz
workshops-ce2d44cdfdc92f40f884845df64c457c24d7c8c9.tar.bz2
workshops-ce2d44cdfdc92f40f884845df64c457c24d7c8c9.zip
Added four_plot.py to exercise folder.
-rw-r--r--day1/exercise/four_plot.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/day1/exercise/four_plot.py b/day1/exercise/four_plot.py
new file mode 100644
index 0000000..5417ee5
--- /dev/null
+++ b/day1/exercise/four_plot.py
@@ -0,0 +1,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()