day1/cheatsheet1.tex
changeset 107 647239f95c4a
child 264 c3a1de5b8216
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/day1/cheatsheet1.tex	Tue Oct 13 13:03:11 2009 +0530
@@ -0,0 +1,55 @@
+\documentclass[12pt]{article}
+\title{Interactive Plotting}
+\author{FOSSEE}
+\begin{document}
+\maketitle
+
+\section{Starting up...}
+\begin{verbatim}
+  $ ipython -pylab  
+\end{verbatim}
+Exiting Ipython
+\begin{verbatim}     
+  In [1]: print "Hello, World!"
+  In [2]: ^D
+  Do you really want to exit ([y]/n)? y
+\end{verbatim}
+Breaking out of loops
+\begin{verbatim}     
+  In [1]: while True:
+    ...:     print "Hello, World!"
+    ...:     
+  Hello, World!
+  Hello, World!^C
+\end{verbatim}
+
+\section{First Plot}
+\begin{verbatim}
+  In [2]: x=linspace(0, 2*pi, 50)
+
+  In [3]: plot(x,sin(x))
+  Out[3]: [<matplotlib.lines.Line2D object at 0xb6e5874c>]
+\end{verbatim}
+
+\section{Labeling}
+\begin{verbatim}
+  In [4]: xlabel('x')
+
+  In [5]: ylabel('sin(x)')
+\end{verbatim}
+
+\section{Another example}
+\begin{verbatim}
+In [6]: clf()
+
+In [7]: y = linspace(0,10,101)
+
+In [8]: plot(y, exp(-y))
+
+In [9]: xlabel('y')
+
+In [10]: ylabel(r'$e^{-y}$')
+\end{verbatim}
+
+\end{document}
+