day1/cheatsheet1.tex
author Santosh G. Vattam <vattam.santosh@gmail.com>
Wed, 14 Oct 2009 20:10:26 +0530
changeset 119 7ae0f756f050
parent 107 647239f95c4a
child 264 c3a1de5b8216
permissions -rw-r--r--
Merged branches.

\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}