embellishing_a_plot/slides.tex
changeset 273 1639ef25a231
parent 235 80e4016d747a
child 524 b602b4dcc87d
equal deleted inserted replaced
272:08638b1e211e 273:1639ef25a231
     1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     1 % Created 2010-10-10 Sun 17:32
     2 %Tutorial slides on Python.
     2 \documentclass[presentation]{beamer}
     3 %
     3 \usepackage[latin1]{inputenc}
     4 % Author: FOSSEE 
     4 \usepackage[T1]{fontenc}
     5 % Copyright (c) 2009, FOSSEE, IIT Bombay
     5 \usepackage{fixltx2e}
     6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     6 \usepackage{graphicx}
       
     7 \usepackage{longtable}
       
     8 \usepackage{float}
       
     9 \usepackage{wrapfig}
       
    10 \usepackage{soul}
       
    11 \usepackage{textcomp}
       
    12 \usepackage{marvosym}
       
    13 \usepackage{wasysym}
       
    14 \usepackage{latexsym}
       
    15 \usepackage{amssymb}
       
    16 \usepackage{hyperref}
       
    17 \tolerance=1000
       
    18 \usepackage[english]{babel} \usepackage{ae,aecompl}
       
    19 \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
       
    20 \usepackage{listings}
       
    21 \lstset{language=Python, basicstyle=\ttfamily\bfseries,
       
    22 commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
       
    23 showstringspaces=false, keywordstyle=\color{blue}\bfseries}
       
    24 \providecommand{\alert}[1]{\textbf{#1}}
     7 
    25 
     8 \documentclass[14pt,compress]{beamer}
    26 \title{Embellishing a Plot}
     9 %\documentclass[draft]{beamer}
    27 \author{FOSSEE}
    10 %\documentclass[compress,handout]{beamer}
       
    11 %\usepackage{pgfpages} 
       
    12 %\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm]
       
    13 
       
    14 % Modified from: generic-ornate-15min-45min.de.tex
       
    15 \mode<presentation>
       
    16 {
       
    17   \usetheme{Warsaw}
       
    18   \useoutertheme{infolines}
       
    19   \setbeamercovered{transparent}
       
    20 }
       
    21 
       
    22 \usepackage[english]{babel}
       
    23 \usepackage[latin1]{inputenc}
       
    24 %\usepackage{times}
       
    25 \usepackage[T1]{fontenc}
       
    26 
       
    27 \usepackage{ae,aecompl}
       
    28 \usepackage{mathpazo,courier,euler}
       
    29 \usepackage[scaled=.95]{helvet}
       
    30 
       
    31 \definecolor{darkgreen}{rgb}{0,0.5,0}
       
    32 
       
    33 \usepackage{listings}
       
    34 \lstset{language=Python,
       
    35     basicstyle=\ttfamily\bfseries,
       
    36     commentstyle=\color{red}\itshape,
       
    37   stringstyle=\color{darkgreen},
       
    38   showstringspaces=false,
       
    39   keywordstyle=\color{blue}\bfseries}
       
    40 
       
    41 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
    42 % Macros
       
    43 \setbeamercolor{emphbar}{bg=blue!20, fg=black}
       
    44 \newcommand{\emphbar}[1]
       
    45 {\begin{beamercolorbox}[rounded=true]{emphbar} 
       
    46       {#1}
       
    47  \end{beamercolorbox}
       
    48 }
       
    49 \newcounter{time}
       
    50 \setcounter{time}{0}
       
    51 \newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}}
       
    52 
       
    53 \newcommand{\typ}[1]{\lstinline{#1}}
       
    54 
       
    55 \newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}}  }
       
    56 
       
    57 % Title page
       
    58 \title{Your Title Here}
       
    59 
       
    60 \author[FOSSEE] {FOSSEE}
       
    61 
       
    62 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
       
    63 \date{}
    28 \date{}
    64 
    29 
    65 % DOCUMENT STARTS
    30 \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
    66 \begin{document}
    31 \begin{document}
    67 
    32 
    68 \begin{frame}
    33 \maketitle
    69   \maketitle
       
    70 \end{frame}
       
    71 
    34 
    72 \begin{frame}[fragile]
       
    73   \frametitle{Outline}
       
    74   \begin{itemize}
       
    75     \item 
       
    76   \end{itemize}
       
    77 \end{frame}
       
    78 
    35 
    79 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
    80 %%              All other slides here.                  %%
       
    81 %% The same slides will be used in a classroom setting. %% 
       
    82 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
    83 
    36 
    84 \begin{frame}[fragile]
    37 
    85   \frametitle{Summary}
    38 
    86   \begin{itemize}
    39 
    87     \item 
    40 
    88   \end{itemize}
    41 
    89 \end{frame}
       
    90 
    42 
    91 \begin{frame}
    43 \begin{frame}
    92   \frametitle{Thank you!}  
    44 \frametitle{Outline}
       
    45 \label{sec-1}
       
    46 
       
    47 \begin{itemize}
       
    48 \item Modifying the color, line style \& linewidth of a plot
       
    49 \item Adding a title to the plot (with embedded \LaTeX{})
       
    50 \item Labelling the axes
       
    51 \item Annotating the plot
       
    52 \item Setting the limits of axes.
       
    53 \end{itemize}
       
    54 \end{frame}
       
    55 \begin{frame}
       
    56 \frametitle{Question 1}
       
    57 \label{sec-2}
       
    58 
       
    59   Plot sin(x) in blue colour and with linewidth as 3
       
    60 \end{frame}
       
    61 \begin{frame}[fragile]
       
    62 \frametitle{Solution 1}
       
    63 \label{sec-3}
       
    64 
       
    65 \lstset{language=Python}
       
    66 \begin{lstlisting}
       
    67 In []: clf()
       
    68 In []: plot(x, sin(x), 'b', linewidth=3)
       
    69 \end{lstlisting}
       
    70 \end{frame}
       
    71 \begin{frame}
       
    72 \frametitle{Question 2}
       
    73 \label{sec-4}
       
    74 
       
    75   Plot the sine curve with green filled circles.
       
    76 \end{frame}
       
    77 \begin{frame}[fragile]
       
    78 \frametitle{Solution 2}
       
    79 \label{sec-5}
       
    80 
       
    81 \lstset{language=Python}
       
    82 \begin{lstlisting}
       
    83 In []: clf()
       
    84 In []: plot(x, cos(x), 'go')
       
    85 \end{lstlisting}
       
    86 \end{frame}
       
    87 \begin{frame}
       
    88 \frametitle{Question 3}
       
    89 \label{sec-6}
       
    90 
       
    91   Plot the curve of x vs tan(x) in red dashed line and linewidth 3
       
    92 \end{frame}
       
    93 \begin{frame}[fragile]
       
    94 \frametitle{Solution 3}
       
    95 \label{sec-7}
       
    96 
       
    97 \lstset{language=Python}
       
    98 \begin{lstlisting}
       
    99 In []: clf()
       
   100 In []: plot(x, cos(x), 'r--')
       
   101 \end{lstlisting}
       
   102 \end{frame}
       
   103 \begin{frame}
       
   104 \frametitle{Question 4}
       
   105 \label{sec-8}
       
   106 
       
   107   Change the title of the figure such that the whole title is
       
   108   formatted in LaTex style
       
   109 \end{frame}
       
   110 \begin{frame}[fragile]
       
   111 \frametitle{Solution 4}
       
   112 \label{sec-9}
       
   113 
       
   114 \lstset{language=Python}
       
   115 \begin{lstlisting}
       
   116 In []: title("$Parabolic function -x^2+4x-5$")
       
   117 \end{lstlisting}
       
   118 \end{frame}
       
   119 \begin{frame}
       
   120 \frametitle{Question 5}
       
   121 \label{sec-10}
       
   122 
       
   123   Set the x and y labels as ``x'' and ``f(x)'' in LaTex style.
       
   124 \end{frame}
       
   125 \begin{frame}[fragile]
       
   126 \frametitle{Solution 5}
       
   127 \label{sec-11}
       
   128 
       
   129 \lstset{language=Python}
       
   130 \begin{lstlisting}
       
   131 In []: xlabel("$x$")
       
   132 In []: yalbel("$f(x)$")
       
   133 \end{lstlisting}
       
   134 \end{frame}
       
   135 \begin{frame}
       
   136 \frametitle{Question 6}
       
   137 \label{sec-12}
       
   138 
       
   139   Make an annotation called ``root'' at the point (-4, 0). What happens
       
   140   to the first annotation?
       
   141 \end{frame}
       
   142 \begin{frame}[fragile]
       
   143 \frametitle{Solution 6}
       
   144 \label{sec-13}
       
   145 
       
   146 \lstset{language=Python}
       
   147 \begin{lstlisting}
       
   148 In []: annotate("root", xy=(-4,0))
       
   149 \end{lstlisting}
       
   150 \end{frame}
       
   151 \begin{frame}
       
   152 \frametitle{Question 7}
       
   153 \label{sec-14}
       
   154 
       
   155   Set the limits of axes such that the area of interest is the
       
   156   rectangle (-1, -15) and (3, 0)
       
   157 \end{frame}
       
   158 \begin{frame}[fragile]
       
   159 \frametitle{Solution 7}
       
   160 \label{sec-15}
       
   161 
       
   162 \lstset{language=Python}
       
   163 \begin{lstlisting}
       
   164 In []: xlim(-1, 3)
       
   165 In []: ylim(-15, 0)
       
   166 \end{lstlisting}
       
   167 \end{frame}
       
   168 \begin{frame}
       
   169 \frametitle{Summary}
       
   170 \label{sec-16}
       
   171 
       
   172 \begin{itemize}
       
   173 \item Modifying the attributes of plot by passing additional arguments
       
   174 \item How to add title
       
   175 \item How to incorporate \LaTeX{} style formatting
       
   176 \item How to label x and y axes
       
   177 \item How to add annotations
       
   178 \item How to set the limits of axes
       
   179 \end{itemize}
       
   180 \end{frame}
       
   181 \begin{frame}
       
   182 \frametitle{Thank you!}
       
   183 \label{sec-17}
       
   184 
    93   \begin{block}{}
   185   \begin{block}{}
    94   \begin{center}
   186   \begin{center}
    95   This spoken tutorial has been produced by the
   187   This spoken tutorial has been produced by the
    96   \textcolor{blue}{FOSSEE} team, which is funded by the 
   188   \textcolor{blue}{FOSSEE} team, which is funded by the 
    97   \end{center}
   189   \end{center}