day1/session1.tex
changeset 381 b797cd67982b
parent 379 682b6f66fe11
child 382 41c34770d63a
equal deleted inserted replaced
380:669b72283b55 381:b797cd67982b
   399 In []: close()
   399 In []: close()
   400 \end{lstlisting}
   400 \end{lstlisting}
   401 Supported formats to store images:
   401 Supported formats to store images:
   402 \begin{itemize}
   402 \begin{itemize}
   403 \item png
   403 \item png
   404 \item eps - Easy to embed in Latex files
   404 \item eps - Easy to embed in LaTeX files
   405 \item emf
   405 \item emf
   406 \item pdf
   406 \item pdf
   407 \item ps
   407 \item ps
   408 \item raw
   408 \item raw
   409 \item rgba
   409 \item rgba
   469   \includegraphics[height=2in, interpolate=true]{data/annotate}  
   469   \includegraphics[height=2in, interpolate=true]{data/annotate}  
   470 \end{center}
   470 \end{center}
   471 \end{frame}
   471 \end{frame}
   472 
   472 
   473 \begin{frame}[fragile]
   473 \begin{frame}[fragile]
   474 \frametitle{Getting axes lengths}
   474 \frametitle{Axes lengths}
       
   475 \emphbar{Getting axes lengths}
   475   \begin{lstlisting}
   476   \begin{lstlisting}
   476 In []: orig_xmin, orig_xmax = xlim() 
   477 In []: xmin, xmax = xlim() 
   477 In []: orig_ymin, orig_ymax = ylim() 
   478 In []: ymin, ymax = ylim() 
   478   \end{lstlisting}
   479   \end{lstlisting}
   479 \end{frame}
   480 \emphbar{Set the axes limits}
   480 
       
   481 \begin{frame}[fragile]
       
   482   \frametitle{Set the axes limits}
       
   483   \begin{lstlisting}
   481   \begin{lstlisting}
   484 In []: up_xmin = orig_xmin
   482 In []: xlim(xmin, 2*pi )
   485 In []: up_xmax = 2*pi
   483 In []: ylim(ymin-0.2, ymax+0.2)
   486 In []: up_ymin = ymin-0.2
       
   487 In []: up_ymax = ymax+0.2
       
   488 
       
   489 In []: xlim(up_xmin, up_xmax)
       
   490 In []: ylim(up_ymin, up_ymax)
       
   491   \end{lstlisting}
   484   \end{lstlisting}
   492 \end{frame}
   485 \end{frame}
   493 
   486 
   494 \begin{frame}[fragile]
   487 \begin{frame}[fragile]
   495 \frametitle{Review Problem}
   488 \frametitle{Review Problem}
   549 
   542 
   550 \begin{frame}[fragile]
   543 \begin{frame}[fragile]
   551   \frametitle{Saving commands into script}
   544   \frametitle{Saving commands into script}
   552 Use the \typ{\%save} \alert{magic} command of IPython
   545 Use the \typ{\%save} \alert{magic} command of IPython
   553 \begin{block}{}
   546 \begin{block}{}
   554 \typ{In []: \%save script_name line_numbers}
   547 \typ{\%save script_name line_numbers}
   555 \end{block}
   548 \end{block}
   556 Line numbers can be specified individually separated by commas or as a range separated by a dash.\\
   549 Line numbers can be specified individually separated by commas or as a range separated by a dash.\\
   557 \begin{block}{}
   550 \begin{block}{}
   558 \typ{In []: \%save four_plot.py} \alert{\typ{16 18-27}} \\  
   551 \typ{\%save four_plot.py} \alert{\typ{16 18-27}} \\  
   559 \end{block}
   552 \end{block}
   560 This saves from the history the commands entered on line numbers \alert{16, 18, 19, 20, \ldots 27}
   553 This saves from the history the commands entered on line numbers \alert{16, 18, 19, 20, \ldots 27}
   561 \end{frame}
   554 \end{frame}
   562 
   555 
   563 \begin{frame}
   556 \begin{frame}