summaryrefslogtreecommitdiff
path: root/scipy
diff options
context:
space:
mode:
authorPrabhu Ramachandran2016-12-22 01:02:51 +0530
committerPrabhu Ramachandran2016-12-22 01:02:51 +0530
commit68e8885c8069715cf9f959699e74859529801b06 (patch)
tree08aff4c098c4047c8176e8758ed486bdf734326a /scipy
parent32241342b7ee7badff23211cfb56a998bde7c82a (diff)
downloadpython-workshops-68e8885c8069715cf9f959699e74859529801b06.tar.gz
python-workshops-68e8885c8069715cf9f959699e74859529801b06.tar.bz2
python-workshops-68e8885c8069715cf9f959699e74859529801b06.zip
Add some sample code for solution.
Diffstat (limited to 'scipy')
-rw-r--r--scipy/basic/code/four_plot.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/scipy/basic/code/four_plot.py b/scipy/basic/code/four_plot.py
new file mode 100644
index 0000000..d113c5f
--- /dev/null
+++ b/scipy/basic/code/four_plot.py
@@ -0,0 +1,9 @@
+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))
+xlim(-5*pi, 5*pi)
+ylim(-5*pi, 5*pi)