embellishing_a_plot/slides.org
changeset 273 1639ef25a231
equal deleted inserted replaced
272:08638b1e211e 273:1639ef25a231
       
     1 #+LaTeX_CLASS: beamer
       
     2 #+LaTeX_CLASS_OPTIONS: [presentation]
       
     3 #+BEAMER_FRAME_LEVEL: 1
       
     4 
       
     5 #+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
       
     6 #+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
       
     7 #+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
       
     8 
       
     9 #+LaTeX_CLASS: beamer
       
    10 #+LaTeX_CLASS_OPTIONS: [presentation]
       
    11 
       
    12 #+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
       
    13 #+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
       
    14 
       
    15 #+LaTeX_HEADER:\usepackage{listings}
       
    16 
       
    17 #+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
       
    18 #+LaTeX_HEADER:  commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
       
    19 #+LaTeX_HEADER:  showstringspaces=false, keywordstyle=\color{blue}\bfseries}
       
    20 
       
    21 #+TITLE:    Embellishing a Plot
       
    22 #+AUTHOR:    FOSSEE
       
    23 #+EMAIL:     
       
    24 #+DATE:    
       
    25 
       
    26 #+DESCRIPTION: 
       
    27 #+KEYWORDS: 
       
    28 #+LANGUAGE:  en
       
    29 #+OPTIONS:   H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
       
    30 #+OPTIONS:   TeX:t LaTeX:nil skip:nil d:nil todo:nil pri:nil tags:not-in-toc
       
    31 
       
    32 * Outline
       
    33   + Modifying the color, line style & linewidth of a plot
       
    34   + Adding a title to the plot (with embedded LaTeX)
       
    35   + Labelling the axes
       
    36   + Annotating the plot
       
    37   + Setting the limits of axes. 
       
    38 * Question 1
       
    39   Plot sin(x) in blue colour and with linewidth as 3
       
    40 * Solution 1
       
    41   #+begin_src python
       
    42     In []: clf()
       
    43     In []: plot(x, sin(x), 'b', linewidth=3)
       
    44   #+end_src
       
    45 * Question 2
       
    46   Plot the sine curve with green filled circles.
       
    47 * Solution 2
       
    48   #+begin_src python
       
    49     In []: clf()
       
    50     In []: plot(x, cos(x), 'go')
       
    51   #+end_src
       
    52 * Question 3
       
    53   Plot the curve of x vs tan(x) in red dashed line and linewidth 3
       
    54 * Solution 3
       
    55   #+begin_src python
       
    56     In []: clf()
       
    57     In []: plot(x, cos(x), 'r--')
       
    58   #+end_src
       
    59 * Question 4
       
    60   Change the title of the figure such that the whole title is
       
    61   formatted in LaTex style
       
    62 * Solution 4 
       
    63   #+begin_src python
       
    64     In []: title("$Parabolic function -x^2+4x-5$")
       
    65   #+end_src
       
    66 * Question 5
       
    67   Set the x and y labels as "x" and "f(x)" in LaTex style.
       
    68 * Solution 5
       
    69   #+begin_src python
       
    70     In []: xlabel("$x$")
       
    71     In []: yalbel("$f(x)$")
       
    72   #+end_src
       
    73 * Question 6
       
    74   Make an annotation called "root" at the point (-4, 0). What happens
       
    75   to the first annotation?
       
    76 * Solution 6
       
    77   #+begin_src python
       
    78     In []: annotate("root", xy=(-4,0))  
       
    79   #+end_src
       
    80 * Question 7
       
    81   Set the limits of axes such that the area of interest is the
       
    82   rectangle (-1, -15) and (3, 0)
       
    83 * Solution 7
       
    84   #+begin_src python
       
    85     In []: xlim(-1, 3)
       
    86     In []: ylim(-15, 0)
       
    87   #+end_src
       
    88 * Summary
       
    89   + Modifying the attributes of plot by passing additional arguments
       
    90   + How to add title
       
    91   + How to incorporate LaTeX style formatting
       
    92   + How to label x and y axes
       
    93   + How to add annotations
       
    94   + How to set the limits of axes
       
    95 
       
    96 * Thank you!
       
    97 #+begin_latex
       
    98   \begin{block}{}
       
    99   \begin{center}
       
   100   This spoken tutorial has been produced by the
       
   101   \textcolor{blue}{FOSSEE} team, which is funded by the 
       
   102   \end{center}
       
   103   \begin{center}
       
   104     \textcolor{blue}{National Mission on Education through \\
       
   105       Information \& Communication Technology \\ 
       
   106       MHRD, Govt. of India}.
       
   107   \end{center}  
       
   108   \end{block}
       
   109 #+end_latex
       
   110 
       
   111