other-type-of-plots/slides.org
changeset 324 4054b1a6392d
parent 308 0a0a91fb3a0d
equal deleted inserted replaced
323:e675f9208b91 324:4054b1a6392d
       
     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: Other type of plots
       
    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   - Scatter plot
       
    34   - Pie chart
       
    35   - Bar chart
       
    36   - Log-log Plot
       
    37   - ~matplotlib~ help
       
    38 * Exercise 1: Scatter plot
       
    39   Plot a scatter plot showing the percentage profit of Company A from the year 2000
       
    40   to 2010. The data for the same is available in the file ~company-a-data.txt~.
       
    41 * ~scatter()~ function
       
    42   - /Syntax :/ scatter(x,y)
       
    43     - x, a sequence of data
       
    44     - y, a sequence of data, the same length of x
       
    45   : In []: scatter(year, profit)
       
    46 * Exercise 2: Scatter plot
       
    47   Plot a scatter plot of the same data in ~company-a-data.txt~ with red diamond markers.
       
    48   : 
       
    49   *Clue* - /try scatter? in your ipython interpreter/
       
    50 * Pie chart
       
    51   Pie chart - a circle graph divided into sectors, illustrating proportion. 
       
    52 * Exercise 3: Pie chart
       
    53   Plot a pie chart representing the profit percentage of company A, with the data 
       
    54   from the file ~company-a-data.txt~.
       
    55   : 
       
    56   /(we can reuse the data in lists year and profit)/
       
    57 * ~pie()~ function
       
    58   - /Syntax :/ pie(values, labels=labels)
       
    59     - values, the data to be plotted
       
    60     - labels, the label for each wedge in the pie chart
       
    61   : In []: pie(profit, labels=year)
       
    62 * Exercise 4: Pie chart
       
    63   Plot a pie chart with the same data with colors for each wedges as white, red, 
       
    64   magenta, yellow, blue, green, cyan, yellow, magenta, and blue.
       
    65   : 
       
    66   *Clue* - /try pie? in your ipython interpreter/
       
    67 * Bar chart
       
    68   Bar chart - a chart with rectangular bars with lengths proportional 
       
    69   to the values that they represent.
       
    70 * Exercise 5: Bar chart
       
    71   Plot a bar chart representing the profit percentage of company A, with the data 
       
    72   from the file ~company-a-data.txt~.
       
    73   : 
       
    74   /(we can reuse the data in lists year and profit)/
       
    75 * ~bar()~ function
       
    76   - /Syntax :/ bar(x, y)
       
    77     - x, a sequence of data
       
    78     - y, a sequence of data, the same length of x
       
    79   : In []: bar(year, profit)
       
    80 * Exercise 6: Bar chart
       
    81   Plot a bar chart which is not filled and which is hatched with 
       
    82   #+begin_latex
       
    83     $45^o$
       
    84   #+end_latex
       
    85   slanting lines as shown in the image. The data for the chart may be
       
    86   obtained from the file ~company-a-data.txt~.
       
    87   #+begin_latex
       
    88    \begin{center}
       
    89       \includegraphics[scale=0.3]{bar-chart-hatch}    
       
    90     \end{center}
       
    91   #+end_latex
       
    92   *Clue* - /try bar? in your ipython interpreter/
       
    93 * Log-log graph
       
    94   - Log-log graph
       
    95     - 2-dimensional graph.
       
    96     - uses logarithmic scales on both axes.
       
    97     - graph appears as straight line due to non-linear scaling.
       
    98 * Exercise 7:
       
    99   Plot a log-log chart of 
       
   100   #+begin_latex
       
   101     $y = 5x^3$
       
   102   #+end_latex
       
   103   for x from 1-20.
       
   104 * ~loglog()~ function
       
   105   - /Syntax :/ loglog(x, y)
       
   106     - x, a sequence of data
       
   107     - y, a sequence of data, the same length of x
       
   108   : In []: loglog(x, y)
       
   109 * Getting help on ~matplotlib~
       
   110   - Help 
       
   111     - [[matplotlib.sourceforge.net/contents.html]]
       
   112   - More plots
       
   113     - [[matplotlib.sourceforge.net/users/screenshots.html]]
       
   114     - [[matplotlib.sourceforge.net/gallery.html]]
       
   115 
       
   116 * Summary
       
   117   - Scatter plot (~scatter()~)
       
   118   - Pie chart (~pie()~)
       
   119   - Bar chart (~bar()~)
       
   120   - Log-log plot (~loglog()~)
       
   121   - ~matplotlib~ online help
       
   122 * Thank you!
       
   123 #+begin_latex
       
   124   \begin{block}{}
       
   125   \begin{center}
       
   126   This spoken tutorial has been produced by the
       
   127   \textcolor{blue}{FOSSEE} team, which is funded by the 
       
   128   \end{center}
       
   129   \begin{center}
       
   130     \textcolor{blue}{National Mission on Education through \\
       
   131       Information \& Communication Technology \\ 
       
   132       MHRD, Govt. of India}.
       
   133   \end{center}  
       
   134   \end{block}
       
   135 #+end_latex
       
   136 
       
   137