day1/cheatsheet1.tex
author Puneeth Chaganti <punchagan@fossee.in>
Thu, 05 Nov 2009 09:22:27 +0530
changeset 271 3f32f679bb45
parent 264 c3a1de5b8216
child 295 39d7c4e14585
permissions -rw-r--r--
Retained only fsolve and roots in finding roots, session6.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
107
647239f95c4a Added rough draft of slides and cheatsheet for Interactive Plotting.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     1
\documentclass[12pt]{article}
647239f95c4a Added rough draft of slides and cheatsheet for Interactive Plotting.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     2
\title{Interactive Plotting}
647239f95c4a Added rough draft of slides and cheatsheet for Interactive Plotting.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     3
\author{FOSSEE}
647239f95c4a Added rough draft of slides and cheatsheet for Interactive Plotting.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     4
\begin{document}
264
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
     5
\date{}
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
     6
\vspace{-1in}
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
     7
\begin{center}
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
     8
\LARGE{Interactive Plotting}\\
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
     9
\large{FOSSEE}
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    10
\end{center}
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    11
\section{Starting up...}
107
647239f95c4a Added rough draft of slides and cheatsheet for Interactive Plotting.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    12
647239f95c4a Added rough draft of slides and cheatsheet for Interactive Plotting.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    13
\begin{verbatim}
647239f95c4a Added rough draft of slides and cheatsheet for Interactive Plotting.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    14
  $ ipython -pylab  
647239f95c4a Added rough draft of slides and cheatsheet for Interactive Plotting.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    15
\end{verbatim}
264
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    16
Exiting 
107
647239f95c4a Added rough draft of slides and cheatsheet for Interactive Plotting.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    17
\begin{verbatim}     
264
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    18
In [2]: (Ctrl-D)^D
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    19
Do you really want to exit ([y]/n)? y
107
647239f95c4a Added rough draft of slides and cheatsheet for Interactive Plotting.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    20
\end{verbatim}
647239f95c4a Added rough draft of slides and cheatsheet for Interactive Plotting.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    21
Breaking out of loops
647239f95c4a Added rough draft of slides and cheatsheet for Interactive Plotting.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    22
\begin{verbatim}     
264
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    23
In [1]: while True:
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    24
   ...:     print "Hello, World!"
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    25
   ...:     
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    26
Hello, World!
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    27
Hello, World!(Ctrl-C)^C
107
647239f95c4a Added rough draft of slides and cheatsheet for Interactive Plotting.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    28
\end{verbatim}
647239f95c4a Added rough draft of slides and cheatsheet for Interactive Plotting.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    29
264
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    30
\section{Plotting}
107
647239f95c4a Added rough draft of slides and cheatsheet for Interactive Plotting.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    31
\begin{verbatim}
264
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    32
In [1]: x = linspace(0, 2*pi, 50)
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    33
In [2]: plot(x,sin(x))
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    34
In [3]: xlabel('x')
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    35
In [4]: ylabel('sin(x)')
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    36
In [5]: legend(['x', '-x', 'sin(x)', 'xsin(x)'])
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    37
In [6]: annotate('origin', xy=(0, 0), xytext=(0, -7),
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    38
                 arrowprops=dict(shrink=0.05))
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    39
In [7]: xlim(5*pi, 5*pi)
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    40
In [8]: ylim(5*pi, 5*pi)
c3a1de5b8216 Updated day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents: 107
diff changeset
    41
In [9]: clf() #Clears the Plot area
107
647239f95c4a Added rough draft of slides and cheatsheet for Interactive Plotting.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    42
\end{verbatim}
647239f95c4a Added rough draft of slides and cheatsheet for Interactive Plotting.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    43
\end{document}
647239f95c4a Added rough draft of slides and cheatsheet for Interactive Plotting.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    44