day1/session1.tex
changeset 337 56aa2efbf7d9
parent 330 46533051b9d3
child 339 8ac5fe07810f
equal deleted inserted replaced
335:45bcdc34bf73 337:56aa2efbf7d9
   445 \item Plot x, -x, sin(x), xsin(x) in range $-5\pi$ to $5\pi$
   445 \item Plot x, -x, sin(x), xsin(x) in range $-5\pi$ to $5\pi$
   446 \item Add a legend
   446 \item Add a legend
   447 \item Annotate the origin
   447 \item Annotate the origin
   448 \item Set axes limits to the range of x
   448 \item Set axes limits to the range of x
   449 \end{enumerate}
   449 \end{enumerate}
       
   450 \vspace*{-0.1in}
       
   451 \begin{center}
       
   452   \includegraphics[height=2.1in, interpolate=true]{data/four_plot}  
       
   453 \end{center}
       
   454 \end{frame}
       
   455 
       
   456 \begin{frame}[fragile]
       
   457 \frametitle{Review Problem \ldots}
       
   458 \alert{Plotting \ldots}
   450 \begin{lstlisting}
   459 \begin{lstlisting}
   451 In []: x=linspace(-5*pi, 5*pi, 500)
   460 In []: x=linspace(-5*pi, 5*pi, 500)
   452 In []: plot(x, x, 'b')
   461 In []: plot(x, x, 'b')
   453 In []: plot(x, -x, 'b')
   462 In []: plot(x, -x, 'b')
   454 \end{lstlisting}
       
   455 $\vdots$
       
   456 \end{frame}
       
   457 
       
   458 \begin{frame}[fragile]
       
   459 \frametitle{Review Problem \ldots}
       
   460 \begin{lstlisting}
       
   461 In []: plot(x, sin(x), 'g', linewidth=2)
   463 In []: plot(x, sin(x), 'g', linewidth=2)
   462 In []: plot(x, x*sin(x), 'r', 
   464 In []: plot(x, x*sin(x), 'r', 
   463             linewidth=3)
   465             linewidth=3)
   464 \end{lstlisting}
   466 \end{lstlisting}
       
   467 $\vdots$
       
   468 \end{frame}
       
   469 
       
   470 \begin{frame}[fragile]
       
   471 \frametitle{Review Problem \ldots}
       
   472 \alert{Legend \& Annotation\ldots}
   465 \begin{lstlisting}
   473 \begin{lstlisting}
   466 In []: legend(['x', '-x', 'sin(x)', 
   474 In []: legend(['x', '-x', 'sin(x)', 
   467                'xsin(x)'])
   475                'xsin(x)'])
   468 In []: annotate('origin', xy = (0, 0))
   476 In []: annotate('origin', xy = (0, 0))
       
   477 \end{lstlisting}
       
   478 \alert{Setting Axes limits\ldots}
       
   479 \begin{lstlisting}
   469 In []: xlim(-5*pi, 5*pi)
   480 In []: xlim(-5*pi, 5*pi)
   470 In []: ylim(-5*pi, 5*pi)
   481 In []: ylim(-5*pi, 5*pi)
   471 \end{lstlisting}
   482 \end{lstlisting}
   472 \end{frame}
   483 \end{frame}
   473 
   484