day2/session1.tex
changeset 12 996fb264fbe2
parent 10 84c3f600045f
child 20 84458ebb6951
equal deleted inserted replaced
11:ae4a0884ec71 12:996fb264fbe2
   220     \typ{less (<)}, \typ{greater (>)} etc.
   220     \typ{less (<)}, \typ{greater (>)} etc.
   221   \item Trig and other functions: \typ{sin(x), arcsin(x), sinh(x),
   221   \item Trig and other functions: \typ{sin(x), arcsin(x), sinh(x),
   222       exp(x), sqrt(x)} etc.
   222       exp(x), sqrt(x)} etc.
   223   \item \typ{sum(x, axis=0), product(x, axis=0), dot(a, bp)}   \inctime{10}
   223   \item \typ{sum(x, axis=0), product(x, axis=0), dot(a, bp)}   \inctime{10}
   224   \end{itemize}
   224   \end{itemize}
   225   \inctime{10}
       
   226 \end{frame}
   225 \end{frame}
   227 
   226 
   228 \subsection{Array Creation \& Slicing, Striding Arrays}
   227 \subsection{Array Creation \& Slicing, Striding Arrays}
   229 \begin{frame}[fragile]
   228 \begin{frame}[fragile]
   230   \frametitle{Array creation functions}
   229   \frametitle{Array creation functions}
   325 >>> savefig('/tmp/test.eps')
   324 >>> savefig('/tmp/test.eps')
   326 \end{lstlisting}
   325 \end{lstlisting}
   327 \begin{itemize}
   326 \begin{itemize}
   328   \item Also: PNG, PDF, PS, EPS, SVG, PDF
   327   \item Also: PNG, PDF, PS, EPS, SVG, PDF
   329 \end{itemize}
   328 \end{itemize}
       
   329 \inctime{5}
   330 \end{frame}
   330 \end{frame}
   331        
   331        
   332 \subsection{Plots - Lines, Labels and Legends}
   332 \subsection{Plots - Lines, Labels and Legends}
   333 \begin{frame}[fragile]
   333 \begin{frame}[fragile]
   334   \frametitle{Basic plotting}
   334   \frametitle{Tweaking plots}
   335 \begin{lstlisting}
   335 \begin{lstlisting}
   336 # Set properties of objects:
   336 # Set properties of objects:
   337 >>> l, = plot(x, sin(x))
   337 >>> l, = plot(x, sin(x))
   338 # Why "l,"?
   338 # Why "l,"?
   339 >>> setp(l, linewidth=2.0, color='r')
   339 >>> setp(l, linewidth=2.0, color='r')
   367 \end{frame}
   367 \end{frame}
   368 
   368 
   369 \begin{frame}[fragile]
   369 \begin{frame}[fragile]
   370   \frametitle{Legends}
   370   \frametitle{Legends}
   371 \begin{lstlisting}
   371 \begin{lstlisting}
       
   372 >>> x = linspace(0, 2*pi, 1000)
   372 >>> plot(x, cos(5*x), 'r--', 
   373 >>> plot(x, cos(5*x), 'r--', 
   373          label='cosine')
   374          label='cosine')
   374 >>> plot(x, sin(5*x), 'g--', 
   375 >>> plot(x, sin(5*x), 'g--', 
   375          label='sine')
   376          label='sine')
   376 >>> legend() 
   377 >>> legend() 
   377 # Or use:
   378 # Or use:
   378 >>> legend(['cosine', 'sine'])
   379 >>> legend(['cosine', 'sine'])
   379 # Annotation:
       
   380 >>> text(1,0, '(1,0)')
       
   381 \end{lstlisting}
   380 \end{lstlisting}
   382 \end{frame}
   381 \end{frame}
   383 
   382 
   384 \begin{frame}[fragile]
   383 \begin{frame}[fragile]
   385     \frametitle{Multiple figures}
   384     \frametitle{Multiple figures}
   404 pylab.plot(x, pylab.sin(x))
   403 pylab.plot(x, pylab.sin(x))
   405 
   404 
   406 # Can also use:
   405 # Can also use:
   407 from pylab import linspace, sin, plot
   406 from pylab import linspace, sin, plot
   408 \end{lstlisting}
   407 \end{lstlisting}
       
   408 \inctime{5}
   409 \end{frame}
   409 \end{frame}
   410 
   410 
   411 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   411 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   412 \subsection{Types of Plots}
   412 \subsection{Types of Plots}
   413 \begin{frame}[fragile]
   413 \begin{frame}[fragile]
   701   \includegraphics[height=2.3in, interpolate=true]{data/plotmap}  
   701   \includegraphics[height=2.3in, interpolate=true]{data/plotmap}  
   702   \begin{center}
   702   \begin{center}
   703     \tiny
   703     \tiny
   704     For details see \url{http://matplotlib.sourceforge.net/screenshots/plotmap.py}
   704     For details see \url{http://matplotlib.sourceforge.net/screenshots/plotmap.py}
   705   \end{center}
   705   \end{center}
       
   706 \inctime{5}
   706 \end{frame}
   707 \end{frame}
   707 
   708 
   708 
   709 
   709 \begin{frame}
   710 \begin{frame}
   710   \frametitle{More information}
   711   \frametitle{More information}
   711   \begin{itemize}
   712   \begin{itemize}
   712   \item More information here: \url{http://matplotlib.sf.net}
   713   \item More information here: \url{http://matplotlib.sf.net}
   713   \item \url{http://matplotlib.sf.net/tutorial.html}
   714   \item \url{http://matplotlib.sf.net/tutorial.html}
   714   \item \url{http://matplotlib.sf.net/screenshots.html}
   715   \item \url{http://matplotlib.sf.net/screenshots.html}
   715   \end{itemize}
   716   \end{itemize}
   716 
       
   717   \inctime{25}
       
   718 \end{frame}
   717 \end{frame}
   719 
   718 
   720 \begin{frame}
   719 \begin{frame}
   721   \frametitle{Problem Set}
   720   \frametitle{Problem Set}
   722   \begin{enumerate}
   721   \begin{enumerate}
   747     \hspace*{-0.5in}
   746     \hspace*{-0.5in}
   748   \includegraphics[height=1.6in, interpolate=true]{data/cobweb}  
   747   \includegraphics[height=1.6in, interpolate=true]{data/cobweb}  
   749 \end{columns}
   748 \end{columns}
   750 \inctime{20}
   749 \inctime{20}
   751 \end{frame}
   750 \end{frame}
   752 
       
   753 \end{document}
   751 \end{document}