diff options
author | Shantanu | 2009-10-03 19:39:49 +0530 |
---|---|---|
committer | Shantanu | 2009-10-03 19:39:49 +0530 |
commit | f091abf11af72b135dd4f127dbe18e670ad7d223 (patch) | |
tree | 997005065026f8da08d4fc1d2922374cc43db0d0 | |
parent | 7bb2da478343f457bfc35ad82ad4be62e569f32a (diff) | |
download | workshops-more-scipy-f091abf11af72b135dd4f127dbe18e670ad7d223.tar.gz workshops-more-scipy-f091abf11af72b135dd4f127dbe18e670ad7d223.tar.bz2 workshops-more-scipy-f091abf11af72b135dd4f127dbe18e670ad7d223.zip |
Added legend() section.
-rw-r--r-- | day2/session1.tex | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/day2/session1.tex b/day2/session1.tex index 0bdae0a..af5e7c2 100644 --- a/day2/session1.tex +++ b/day2/session1.tex @@ -330,7 +330,7 @@ array([[ 0.96276665, 0.77174861], \inctime{5} \end{frame} -\subsection{Plots - Lines, Labels} +\subsection{Plots - Lines, Labels, Legend} \begin{frame}[fragile] \frametitle{Basic plotting} \begin{lstlisting} @@ -367,6 +367,20 @@ array([[ 0.96276665, 0.77174861], \end{frame} \begin{frame}[fragile] + \frametitle{Legends} +\begin{lstlisting} +>>> x = linspace(0, 2*pi, 1000) +>>> plot(x, cos(5*x), 'r--', + label='cosine') +>>> plot(x, sin(5*x), 'g--', + label='sine') +>>> legend() +# Or use: +>>> legend(['cosine', 'sine']) +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] \frametitle{Multiple figures} \begin{lstlisting} @@ -683,7 +697,7 @@ title('triangular head; scale '\ \end{frame} \begin{frame}[fragile] \frametitle{Maps} - \includegraphics[height=2.5in, interpolate=true]{data/plotmap} + \includegraphics[height=2.3in, interpolate=true]{data/plotmap} \begin{center} \tiny For details see \url{http://matplotlib.sourceforge.net/screenshots/plotmap.py} |