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} |