day1/cheatsheet1.tex
author Puneeth Chaganti <punchagan@fossee.in>
Sat, 31 Oct 2009 01:23:23 +0530
changeset 264 c3a1de5b8216
parent 107 647239f95c4a
child 295 39d7c4e14585
permissions -rw-r--r--
Updated day1 session1.

\documentclass[12pt]{article}
\title{Interactive Plotting}
\author{FOSSEE}
\begin{document}
\date{}
\vspace{-1in}
\begin{center}
\LARGE{Interactive Plotting}\\
\large{FOSSEE}
\end{center}
\section{Starting up...}

\begin{verbatim}
  $ ipython -pylab  
\end{verbatim}
Exiting 
\begin{verbatim}     
In [2]: (Ctrl-D)^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!(Ctrl-C)^C
\end{verbatim}

\section{Plotting}
\begin{verbatim}
In [1]: x = linspace(0, 2*pi, 50)
In [2]: plot(x,sin(x))
In [3]: xlabel('x')
In [4]: ylabel('sin(x)')
In [5]: legend(['x', '-x', 'sin(x)', 'xsin(x)'])
In [6]: annotate('origin', xy=(0, 0), xytext=(0, -7),
                 arrowprops=dict(shrink=0.05))
In [7]: xlim(5*pi, 5*pi)
In [8]: ylim(5*pi, 5*pi)
In [9]: clf() #Clears the Plot area
\end{verbatim}
\end{document}