75 \title[Interactive Plotting]{Python for Science and Engg: Interactive Plotting} |
75 \title[Interactive Plotting]{Python for Science and Engg: Interactive Plotting} |
76 |
76 |
77 \author[FOSSEE] {FOSSEE} |
77 \author[FOSSEE] {FOSSEE} |
78 |
78 |
79 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay} |
79 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay} |
80 \date[] {11 January, 2010\\Day 1, Session 1} |
80 \date[] {28 January, 2010\\Day 1, Session 1} |
81 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
81 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
82 |
82 |
83 %\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo} |
83 %\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo} |
84 %\logo{\pgfuseimage{iitmlogo}} |
84 %\logo{\pgfuseimage{iitmlogo}} |
85 |
85 |
121 %% \tableofcontents |
121 %% \tableofcontents |
122 %% % You might wish to add the option [pausesections] |
122 %% % You might wish to add the option [pausesections] |
123 %% \end{frame} |
123 %% \end{frame} |
124 |
124 |
125 \begin{frame} |
125 \begin{frame} |
126 \frametitle{Workshop Schedule: Day 1} |
|
127 \begin{description} |
|
128 \item[Session 1] Mon 09:00--10:00 |
|
129 \item[Session 2] Mon 10:05--11:05 |
|
130 \item[Session 3] Mon 11:20--12:20 |
|
131 \item[Session 4] Mon 12:25--13:25 |
|
132 \item[Quiz 1] Mon 14:25--14:40 |
|
133 \item[Exercises] Mon 14:40--15:25 |
|
134 \item[Session 5] Mon 15:40--16:40 |
|
135 \item[Quiz 2] Mon 16:45--17:00 |
|
136 \end{description} |
|
137 \end{frame} |
|
138 |
|
139 \begin{frame} |
|
140 \frametitle{Workshop Schedule: Day 2} |
|
141 \begin{description} |
|
142 \item[Session 1] Tue 09:00--10:00 |
|
143 \item[Session 2] Tue 10:05--11:05 |
|
144 \item[Session 3] Tue 11:20--12:20 |
|
145 \item[Session 4] Tue 12:25--13:25 |
|
146 \item[Quiz 1] Tue 14:25--14:40 |
|
147 \item[Exercises] Tue 14:40--15:25 |
|
148 \item[Session 5] Tue 15:40--16:40 |
|
149 \item[Quiz 2] Tue 16:45--17:00 |
|
150 \end{description} |
|
151 \end{frame} |
|
152 |
|
153 \begin{frame} |
|
154 \frametitle{About the Workshop} |
126 \frametitle{About the Workshop} |
155 \begin{block}{Intended Audience} |
127 \begin{block}{Intended Audience} |
156 \begin{itemize} |
128 \begin{itemize} |
157 \item Engg., Mathematics and Science teachers. |
129 \item Engg., Mathematics and Science teachers. |
158 \item Interested students from similar streams. |
130 \item Interested students from similar streams. |
166 \item Train students for the same. |
138 \item Train students for the same. |
167 \end{itemize} |
139 \end{itemize} |
168 \end{block} |
140 \end{block} |
169 \end{frame} |
141 \end{frame} |
170 |
142 |
171 \section{Getting started} |
|
172 \begin{frame} |
|
173 \frametitle{Checklist} |
|
174 \begin{enumerate} |
|
175 \item IPython |
|
176 \item Editor: We recommend \alert{scite}. |
|
177 \item Data files: |
|
178 \begin{itemize} |
|
179 \item \typ{sslc1.txt} |
|
180 \item \typ{pendulum.txt} |
|
181 \item \typ{points.txt} |
|
182 \item \typ{pos.txt} |
|
183 \item \typ{holmes.txt} |
|
184 \end{itemize} |
|
185 \item Python scripts: |
|
186 \begin{itemize} |
|
187 \item \typ{sslc_allreg.py} |
|
188 \item \typ{sslc_science.py} |
|
189 \end{itemize} |
|
190 \item Images |
|
191 \begin{itemize} |
|
192 \item \typ{lena.png} |
|
193 \item \typ{smoothing.gif} |
|
194 \end{itemize} |
|
195 \end{enumerate} |
|
196 \end{frame} |
|
197 |
|
198 \begin{frame}[fragile] |
|
199 \frametitle{Starting up \ldots} |
|
200 \begin{block}{} |
|
201 \begin{lstlisting} |
|
202 $ ipython -pylab |
|
203 \end{lstlisting} %$ |
|
204 \end{block} |
|
205 \begin{lstlisting} |
|
206 In []: print "Hello, World!" |
|
207 Hello, World! |
|
208 \end{lstlisting} |
|
209 Exiting |
|
210 \begin{lstlisting} |
|
211 In []: ^D(Ctrl-D) |
|
212 Do you really want to exit([y]/n)? y |
|
213 \end{lstlisting} |
|
214 \end{frame} |
|
215 |
|
216 %% \begin{frame}[fragile] |
|
217 %% \frametitle{Loops} |
|
218 %% Breaking out of loops |
|
219 %% \begin{lstlisting} |
|
220 %% In []: while True: |
|
221 %% ...: print "Hello, World!" |
|
222 %% ...: |
|
223 %% Hello, World! |
|
224 %% Hello, World!^C(Ctrl-C) |
|
225 %% ------------------------------------ |
|
226 %% KeyboardInterrupt |
|
227 |
|
228 %% \end{lstlisting} |
|
229 %% \end{frame} |
|
230 |
|
231 \section{Plotting} |
143 \section{Plotting} |
232 |
|
233 \subsection{Drawing plots} |
144 \subsection{Drawing plots} |
234 \begin{frame}[fragile] |
145 \begin{frame}[fragile] |
235 \frametitle{First Plot} |
146 \frametitle{First Plot} |
236 \begin{columns} |
147 \begin{columns} |
237 \column{0.25\textwidth} |
148 \column{0.25\textwidth} |
246 \end{lstlisting} |
157 \end{lstlisting} |
247 \end{small} |
158 \end{small} |
248 \end{block} |
159 \end{block} |
249 \end{columns} |
160 \end{columns} |
250 \end{frame} |
161 \end{frame} |
251 |
|
252 |
162 |
253 \begin{frame}[fragile] |
163 \begin{frame}[fragile] |
254 \frametitle{Walkthrough} |
164 \frametitle{Walkthrough} |
255 \begin{block}{\typ{x = linspace(start, stop, num)} } |
165 \begin{block}{\typ{x = linspace(start, stop, num)} } |
256 returns \typ{num} evenly spaced points, in the interval [\typ{start}, \typ{stop}]. |
166 returns \typ{num} evenly spaced points, in the interval [\typ{start}, \typ{stop}]. |
486 |
396 |
487 \begin{frame}[fragile] |
397 \begin{frame}[fragile] |
488 \frametitle{Saving Commands} |
398 \frametitle{Saving Commands} |
489 Save commands of review problem into file |
399 Save commands of review problem into file |
490 \begin{itemize} |
400 \begin{itemize} |
491 \item Use \typ{\%hist} command of IPython |
401 \item Use \typ{\%hist} command of IPython (Recall \%\typ{hist} from the previous session) |
492 \item Identify the required line numbers |
402 \item Identify the required line numbers |
493 \item Then, use \typ{\%save} command of IPython |
403 \item Then, use \typ{\%save} command of IPython (Recall \%\typ{save} from the previous session) |
494 \end{itemize} |
404 \end{itemize} |
495 \typ{In []: \%hist}\\ |
405 \typ{In []: \%hist}\\ |
496 \typ{In []: \%save four_plot.py} \alert{\typ{16 18-27}} |
406 \typ{In []: \%save four_plot.py} \alert{\typ{16 18-27}} |
497 \begin{block}{Careful about errors!} |
407 \begin{block}{Careful about errors!} |
498 \kwrd{\%hist} will contain the errors as well,\\ |
408 \kwrd{\%hist} will contain the errors as well,\\ |
509 \end{frame} |
419 \end{frame} |
510 |
420 |
511 \begin{frame}[fragile] |
421 \begin{frame}[fragile] |
512 \frametitle{What did we learn?} |
422 \frametitle{What did we learn?} |
513 \begin{itemize} |
423 \begin{itemize} |
514 \item \kwrd{\%hist} |
|
515 \item Saving commands to a script |
|
516 \item Running a script using \kwrd{\%run -i} |
424 \item Running a script using \kwrd{\%run -i} |
517 \item Creating simple plots. |
425 \item Creating simple plots. |
518 \item Adding labels and legends. |
426 \item Adding labels and legends. |
519 \item Annotating plots. |
427 \item Annotating plots. |
520 \item Changing the looks: size, linewidth |
428 \item Changing the looks: size, linewidth |