Added legend() section.
authorShantanu <shantanu@fossee.in>
Sat, 03 Oct 2009 19:39:49 +0530
changeset 8 41bdf277c755
parent 7 adcc40e2bf70
child 10 84c3f600045f
Added legend() section.
day2/session1.tex
--- a/day2/session1.tex	Sat Oct 03 19:08:47 2009 +0530
+++ b/day2/session1.tex	Sat Oct 03 19:39:49 2009 +0530
@@ -330,7 +330,7 @@
 \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 @@
 \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 @@
 \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}