# HG changeset patch # User Santosh G. Vattam # Date 1269283190 -19800 # Node ID b797cd67982bad9a6666e2a5bb74aed96e610fbf # Parent 669b72283b55fd53512ebece8fdf59c51af5afe9 Updated changes from GRDCS. diff -r 669b72283b55 -r b797cd67982b day1/session1.tex --- a/day1/session1.tex Thu Mar 11 18:01:23 2010 +0530 +++ b/day1/session1.tex Tue Mar 23 00:09:50 2010 +0530 @@ -401,7 +401,7 @@ Supported formats to store images: \begin{itemize} \item png -\item eps - Easy to embed in Latex files +\item eps - Easy to embed in LaTeX files \item emf \item pdf \item ps @@ -471,23 +471,16 @@ \end{frame} \begin{frame}[fragile] -\frametitle{Getting axes lengths} +\frametitle{Axes lengths} +\emphbar{Getting axes lengths} \begin{lstlisting} -In []: orig_xmin, orig_xmax = xlim() -In []: orig_ymin, orig_ymax = ylim() +In []: xmin, xmax = xlim() +In []: ymin, ymax = ylim() \end{lstlisting} -\end{frame} - -\begin{frame}[fragile] - \frametitle{Set the axes limits} +\emphbar{Set the axes limits} \begin{lstlisting} -In []: up_xmin = orig_xmin -In []: up_xmax = 2*pi -In []: up_ymin = ymin-0.2 -In []: up_ymax = ymax+0.2 - -In []: xlim(up_xmin, up_xmax) -In []: ylim(up_ymin, up_ymax) +In []: xlim(xmin, 2*pi ) +In []: ylim(ymin-0.2, ymax+0.2) \end{lstlisting} \end{frame} @@ -551,11 +544,11 @@ \frametitle{Saving commands into script} Use the \typ{\%save} \alert{magic} command of IPython \begin{block}{} -\typ{In []: \%save script_name line_numbers} +\typ{\%save script_name line_numbers} \end{block} Line numbers can be specified individually separated by commas or as a range separated by a dash.\\ \begin{block}{} -\typ{In []: \%save four_plot.py} \alert{\typ{16 18-27}} \\ +\typ{\%save four_plot.py} \alert{\typ{16 18-27}} \\ \end{block} This saves from the history the commands entered on line numbers \alert{16, 18, 19, 20, \ldots 27} \end{frame} diff -r 669b72283b55 -r b797cd67982b day1/session2.tex --- a/day1/session2.tex Thu Mar 11 18:01:23 2010 +0530 +++ b/day1/session2.tex Tue Mar 23 00:09:50 2010 +0530 @@ -281,7 +281,7 @@ \begin{frame}[fragile] \frametitle{Lets use lists} \begin{lstlisting} -In []: l = [0.1, 0.2, 0.3, 0.4, 0.5, +In []: L = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9] In []: t = [0.69, 0.90, 1.19, @@ -309,9 +309,12 @@ ....: ....: -In []: print len(l), len(t), len(tsq) \end{lstlisting} This gives \kwrd{tsq} which is the list of squares of \typ{t} values. +\begin{lstlisting} +In []: print len(L), len(t), len(tsq) +Out[]: 9 9 9 +\end{lstlisting} \end{frame} \begin{frame}[fragile] @@ -323,7 +326,7 @@ ....: ....: - In []: plot(l, tsq) + In []: plot(L, tsq) \end{lstlisting} \end{frame} @@ -362,16 +365,16 @@ \frametitle{Plotting from \typ{pendulum.txt}} Open a new script and type the following: \begin{lstlisting} -l = [] +L = [] t = [] for line in open('pendulum.txt'): point = line.split() - l.append(float(point[0])) + L.append(float(point[0])) t.append(float(point[1])) tsq = [] for time in t: tsq.append(time*time) -plot(l, tsq, '.') +plot(L, tsq, '.') \end{lstlisting} \end{frame} @@ -448,16 +451,16 @@ \begin{frame}[fragile] \frametitle{Let's review the code} \begin{lstlisting} -l = [] +L = [] t = [] for line in open('pendulum.txt'): point = line.split() - l.append(float(point[0])) + L.append(float(point[0])) t.append(float(point[1])) tsq = [] for time in t: tsq.append(time*time) -plot(l, tsq, '.') +plot(L, tsq, '.') \end{lstlisting} \end{frame}