day1/session1.tex
changeset 129 d3aae4b05e99
parent 113 e7febbccd376
child 130 8905a5badd7e
equal deleted inserted replaced
128:b4a83ea1a517 129:d3aae4b05e99
   188 
   188 
   189 \begin{frame}[fragile]
   189 \begin{frame}[fragile]
   190 \frametitle{Title and Legends}
   190 \frametitle{Title and Legends}
   191 \begin{lstlisting}
   191 \begin{lstlisting}
   192 In []: title('Sinusoids')
   192 In []: title('Sinusoids')
       
   193 #Sets the title of the figure
       
   194 
       
   195 In []: legend() 
   193 # When plot made with label
   196 # When plot made with label
   194 # plot(y, -2*sin(-y), label='sin')
   197 # plot(y, -2*sin(-y), label='sin')
   195 In []: legend() 
   198 In []: legend(['sin'])
   196 # When no label, or to change
   199 # When no label, or to change
   197 In []: legend(['sin'])
   200 
   198 \end{lstlisting}
   201 \end{lstlisting}
   199 \end{frame}
   202 \end{frame}
   200 
   203 
   201 \begin{frame}[fragile]
   204 \begin{frame}[fragile]
   202 \frametitle{Changing Legend Placement}
   205 \frametitle{Changing Legend Placement}
   255 
   258 
   256 \begin{frame}[fragile]
   259 \begin{frame}[fragile]
   257 \frametitle{Showing it better}
   260 \frametitle{Showing it better}
   258 \begin{lstlisting}
   261 \begin{lstlisting}
   259 In []: plot(y, sin(y), 'g')
   262 In []: plot(y, sin(y), 'g')
   260 In []: plot(y, sin(y), linewidth=2)  
   263 # plots the curve using green color
       
   264 
       
   265 In []: plot(y, sin(y), linewidth=2)
       
   266 # sets the linewidth to 2  
   261 \end{lstlisting}
   267 \end{lstlisting}
   262 \end{frame}
   268 \end{frame}
   263 
   269 
   264 \begin{frame}[fragile]
   270 \begin{frame}[fragile]
   265 \frametitle{Annotating}
   271 \frametitle{Annotating}
   266 \begin{lstlisting}
   272 \begin{lstlisting}
   267 In []: annotate('Sample point',
   273 In []: annotate('Sample point',
   268                 (50,200))
   274                 (50,200))
       
   275 # Adds the note 'Sample point' at 
       
   276 # the point (50, 200)
   269 \end{lstlisting}
   277 \end{lstlisting}
   270 \end{frame}
   278 \end{frame}
   271 
   279 
   272 \begin{frame}[fragile]
   280 \begin{frame}[fragile]
   273 \frametitle{Axes lengths}
   281 \frametitle{Axes lengths}
   274   \begin{lstlisting}
   282   \begin{lstlisting}
   275 #Get the limits
   283 #Get the axes limits
   276 In []: xmin, xmax = xlim() 
   284 In []: xmin, xmax = xlim() 
   277 In []: ymin, ymax = ylim() 
   285 In []: ymin, ymax = ylim() 
   278 
   286 
   279 #Set the limits
   287 #Set the axes limits
   280 In []: xlim( xmin, xmax ) 
   288 In []: xlim( xmin, xmax ) 
   281 In []: ylim( ymin, ymax ) 
   289 In []: ylim( ymin, ymax ) 
   282   \end{lstlisting}
   290   \end{lstlisting}
   283 \end{frame}
   291 \end{frame}
   284 
   292