diff options
author | Puneeth Chaganti | 2010-12-09 14:34:40 +0530 |
---|---|---|
committer | Puneeth Chaganti | 2010-12-09 14:34:40 +0530 |
commit | 36b7c5d99f4714ecdbdd0746dc5113f60dd05165 (patch) | |
tree | e44822a2f9491d4188a1329e7883a185a2149c4f | |
parent | 2679b58f4c09aae522f4f22df467f544ee6745db (diff) | |
download | workshops-36b7c5d99f4714ecdbdd0746dc5113f60dd05165.tar.gz workshops-36b7c5d99f4714ecdbdd0746dc5113f60dd05165.tar.bz2 workshops-36b7c5d99f4714ecdbdd0746dc5113f60dd05165.zip |
Updated day1/session1.tex and some image files.
--HG--
branch : scipyin2010
-rw-r--r-- | day1/data/legend.png | bin | 33003 -> 44089 bytes | |||
-rw-r--r-- | day1/data/position.png | bin | 28574 -> 46709 bytes | |||
-rw-r--r-- | day1/data/title.png | bin | 28516 -> 31132 bytes | |||
-rw-r--r-- | day1/session1.tex | 240 |
4 files changed, 66 insertions, 174 deletions
diff --git a/day1/data/legend.png b/day1/data/legend.png Binary files differindex 9d28a71..3c25b64 100644 --- a/day1/data/legend.png +++ b/day1/data/legend.png diff --git a/day1/data/position.png b/day1/data/position.png Binary files differindex f4108bc..6538c89 100644 --- a/day1/data/position.png +++ b/day1/data/position.png diff --git a/day1/data/title.png b/day1/data/title.png Binary files differindex cbb588d..9b5a051 100644 --- a/day1/data/title.png +++ b/day1/data/title.png diff --git a/day1/session1.tex b/day1/session1.tex index 50aa6f9..763b56a 100644 --- a/day1/session1.tex +++ b/day1/session1.tex @@ -77,8 +77,7 @@ \author[FOSSEE group] {FOSSEE} \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay} -\date[] {SciPy 2010, Introductory tutorials,\\ -Day 1, Session 1} +\date[] {SciPy.in 2010, Tutorials} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo} @@ -123,47 +122,6 @@ Day 1, Session 1} %% % You might wish to add the option [pausesections] %% \end{frame} -\begin{frame} - \frametitle{Acknowledgement} - \Large - \begin{center} - \alert{FOSSEE group (\url{fossee.in})} \\ - based at\\ - \alert{IIT Bombay}\\ - and funded by\\ - The National Mission on Education through ICT, \\ - \alert{Ministry of HRD, India} - \end{center} -\end{frame} - -\begin{frame} - \frametitle{Tutorial Schedule: Day 1} - \begin{description} - \item[Session 1-2] 08:00--10:00 - \item[Coffee Break] 10:00--10:20 - \item[Session 3-4] 10:20--12:20 - \item[Lunch Break] 12:20--13:40 - \item[Quiz 1] 13:40--13:55 - \item[Exercises] 14:00--14:40 - \item[Session 5] 14:40--15:40 - \item[Coffee Break] 15:40--16:00 - \item[Quiz 2] 16:00--16:15 - \item[Session 6-7] 16:15--18:00 - \end{description} -\end{frame} - -\begin{frame} - \frametitle{Tutorial Schedule: Day 2} - \begin{description} - \item[Session 1] 08:00--9:00 - \item[Session 2] 9:00--10:00 - \item[Coffee] 10:00--10:20 - \item[Quiz 3] 10:20--10:35 - \item[Exercises] 10:35--11:30 - \item[Session 3] 11:30--12:20 - \end{description} -\end{frame} - \section{Checklist} \begin{frame} \frametitle{Checklist} @@ -191,41 +149,6 @@ Day 1, Session 1} \end{enumerate} \end{frame} -\begin{frame} - \frametitle{About the Tutorial} - \begin{block}{Intended Audience} - \begin{itemize} - \item Engg., Mathematics and Science researchers with a - reasonable programming background. - \end{itemize} - \end{block} - - \begin{block}{Goal: Successful participants will be able to} - \begin{itemize} - \item Use Python as plotting, computational tool. - \item Understand how to use Python as a scripting and problem solving language. - \end{itemize} - \end{block} -\end{frame} - -%% \begin{frame}[fragile] -%% \frametitle{The Python interpreter \ldots} -%% \begin{block}{} -%% \begin{lstlisting} -%% $ python -%% \end{lstlisting} %$ -%% \end{block} -%% \begin{lstlisting} -%% >>> print "Hello, World!" -%% Hello, World! -%% \end{lstlisting} -%% Exiting -%% \begin{lstlisting} -%% >>> ^D(Ctrl-D) -%% $ -%% \end{lstlisting} %$ -%% \end{frame} - \section{Starting up IPython} \begin{frame}[fragile] \frametitle{Starting up \ldots} @@ -245,35 +168,6 @@ Exiting \end{lstlisting} \end{frame} -%% \section{Ipython with magic} -%% \begin{frame}[fragile] -%% \frametitle{Let the magic begin \ldots} -%% \begin{itemize} -%% \item \alert{IPython is an improved interpreter}\\ -%% \item \alert{Recommended for Scientific and Computing work}\\ -%% \end{itemize} -%% \begin{block}{} -%% \begin{lstlisting} -%% $ ipython -pylab -%% \end{lstlisting} %$ -%% \end{block} -%% \end{frame} - -\section{Breaking out of loops} -\begin{frame}[fragile] -\frametitle{Breaking out of Loops} -Breaking out of loops -\begin{lstlisting} - In []: while True: - ...: print "Hello, World!" - ...: - Hello, World! - Hello, World!^C(Ctrl-C) - ------------------------------------ - KeyboardInterrupt -\end{lstlisting} -\end{frame} - \section{Plotting} \subsection{Drawing plots} \begin{frame}[fragile] @@ -351,6 +245,42 @@ In []: ylabel('sin(2y)') \end{frame} \begin{frame}[fragile] +\frametitle{Title} +\vspace*{-0.15in} +% \begin{block}{} +% \small +\begin{lstlisting} +In []: title('Sinusoids') +\end{lstlisting} +% \small +% \end{block} + \vspace*{-0.1in} + \begin{center} + \includegraphics[height=2in, interpolate=true]{data/title} + \end{center} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Saving \& Closing} +\begin{lstlisting} +In []: savefig('sin.png') + +In []: close() +\end{lstlisting} +Supported formats to store images: +\begin{itemize} +\item png +\item eps - Easy to embed in LaTeX files +\item emf +\item pdf +\item ps +\item raw +\item rgba +\item svg +\end{itemize} +\end{frame} + +\begin{frame}[fragile] \frametitle{IPython tips \ldots} \begin{itemize} @@ -363,28 +293,30 @@ In []: ylabel('sin(2y)') \item Accesses history (also from past sessions) \item Up and down arrows (\typ{Ctrl-p}/\typ{Ctrl-n}) - - \item Search: \typ{Ctrl-r} and start typing - - \item \typ{Ctrl-a}: go to start of line - - \item \typ{Ctrl-e}: end of line - - \item \typ{Ctrl-k}: kill to end of line \end{itemize} \end{frame} +\section{Multiple plots} +\begin{frame}[fragile] +\frametitle{Overlaid Plots} +\begin{lstlisting} +In []: clf() +In []: plot(y, sin(y)) +In []: plot(y, cos(y)) +In []: xlabel('y') +In []: ylabel('f(y)') +\end{lstlisting} +\emphbar{By default plots would be overlaid!} +\end{frame} -\subsection{More decoration} \begin{frame}[fragile] -\frametitle{Title and Legends} +\frametitle{Legend} \vspace*{-0.15in} % \begin{block}{} % \small \begin{lstlisting} -In []: title('Sinusoids') -In []: legend(['sin(2y)']) +In []: legend(['sin(y)', 'cos(y)']) \end{lstlisting} % \small % \end{block} @@ -399,7 +331,7 @@ In []: legend(['sin(2y)']) \begin{block}{} \small \begin{lstlisting} -In []: legend(['sin(2y)'], loc = 'center') +In []: legend(['sin(y)', 'cos(y)'], loc='center') \end{lstlisting} \end{block} @@ -416,54 +348,6 @@ In []: legend(['sin(2y)'], loc = 'center') \end{columns} \end{frame} -%% \begin{frame}[fragile] -%% \frametitle{For arbitrary location} -%% \vspace*{-0.1in} -%% \begin{lstlisting} -%% In []: legend(['sin(2y)'], loc=(.8,.1)) -%% \end{lstlisting} -%% \emphbar{Specify south-east corner position} -%% %\vspace*{-0.2in} -%% \begin{center} -%% \includegraphics[height=2in, interpolate=true]{data/loc} -%% \end{center} -%% %\inctime{10} -%% \end{frame} - -\begin{frame}[fragile] -\frametitle{Saving \& Closing} -\begin{lstlisting} -In []: savefig('sin.png') - -In []: close() -\end{lstlisting} -Supported formats to store images: -\begin{itemize} -\item png -\item eps - Easy to embed in LaTeX files -\item emf -\item pdf -\item ps -\item raw -\item rgba -\item svg -\end{itemize} -\end{frame} - -\section{Multiple plots} -\begin{frame}[fragile] -\frametitle{Overlaid Plots} -\begin{lstlisting} -In []: clf() -In []: plot(y, sin(y)) -In []: plot(y, cos(y)) -In []: xlabel('y') -In []: ylabel('f(y)') -In []: legend(['sin(y)', 'cos(y)']) -\end{lstlisting} -\emphbar{By default plots would be overlaid!} -\end{frame} - \begin{frame}[fragile] \frametitle{Plotting separate figures} \begin{lstlisting} @@ -618,9 +502,9 @@ Use the \typ{\%save} \alert{magic} command of IPython \end{block} Line numbers can be specified individually separated by spaces or as a range separated by a dash.\\ \begin{block}{} -\typ{\%save four_plot.py} \alert{\typ{ 16 18-27}} \\ +\typ{\%save four_plot.py} \alert{\typ{ 16-18 21 25 27-32}} \\ \end{block} -This saves from the history the commands entered on line numbers \alert{16, 18, 19, 20, \ldots 27} +This saves from the history the commands entered on line numbers \alert{16, 17, 18, 21, 25, 27, 28, 29, 30, 31, 32} \end{frame} \begin{frame} @@ -637,10 +521,17 @@ To avoid this, run using \alert{\typ{\%run -i four_plot.py}}\\ \end{frame} \begin{frame}[fragile] - \frametitle{Result graph} - \begin{center} - \includegraphics[height=3in, interpolate=true]{data/four_plot} - \end{center} +\frametitle{Doing this in Sage\ldots} + \begin{itemize} + \item Change the language to =Python= + \item Make a simple plot and save it + \begin{lstlisting} + from pylab import * + x = linspace(0, 2*pi, 50) + plot(x, sin(x)) + savefig('sample-sin.png') + \end{lstlisting} + \end{itemize} \end{frame} \begin{frame}[fragile] @@ -655,6 +546,7 @@ To avoid this, run using \alert{\typ{\%run -i four_plot.py}}\\ \item \kwrd{\%hist} - History of commands \item \kwrd{\%save} - Saving commands \item Running a script using \kwrd{\%run -i} + \item Using \lstinline|pylab| in Sage \end{itemize} \end{frame} |