355 In []: ylim(ymin, ymax) |
355 In []: ylim(ymin, ymax) |
356 \end{lstlisting} |
356 \end{lstlisting} |
357 \end{frame} |
357 \end{frame} |
358 |
358 |
359 \begin{frame}[fragile] |
359 \begin{frame}[fragile] |
|
360 \frametitle{Review Problem} |
|
361 \begin{enumerate} |
|
362 \item Plot x, -x, sin(x), xsin(x) in the range $-5\pi$ to $5\pi$ |
|
363 \item Add a legend |
|
364 \item Annotate the origin |
|
365 \item Set axis limits to the range of x |
|
366 \end{enumerate} |
|
367 \begin{lstlisting} |
|
368 In []: x=linspace(-5*pi, 5*pi, 501) |
|
369 In []: plot(x, x, 'b') |
|
370 In []: plot(x, -x, 'b') |
|
371 \end{lstlisting} |
|
372 $\vdots$ |
|
373 \end{frame} |
|
374 |
|
375 \begin{frame}[fragile] |
|
376 \frametitle{Review Problem \ldots} |
|
377 \small{ |
|
378 \begin{lstlisting} |
|
379 In []: plot(x, sin(x), 'g', linewidth=2) |
|
380 In []: plot(x, x*sin(x), 'r', linewidth=3) |
|
381 \end{lstlisting} |
|
382 |
|
383 \begin{lstlisting} |
|
384 In []: legend(['x', '-x', 'sin(x)', 'xsin(x)']) |
|
385 In []: annotate('origin', |
|
386 xy=(0, 0), |
|
387 xytext=(0, -7), |
|
388 arrowprops=dict( |
|
389 shrink=0.05)) |
|
390 In []: xlim(5*pi, 5*pi) |
|
391 In []: ylim(5*pi, 5*pi) |
|
392 \end{lstlisting} |
|
393 } |
|
394 \end{frame} |
|
395 |
|
396 \begin{frame}[fragile] |
360 \begin{center} |
397 \begin{center} |
361 End of Session-1\\ |
398 End of Session-1\\ |
362 \alert{Don't Close \typ{IPython}} |
399 \alert{Don't Close \typ{IPython}} |
363 \end{center} |
400 \end{center} |
364 \end{frame} |
401 \end{frame} |