savefig/slides.org
author Nishanth <nishanth@fossee.in>
Tue, 12 Oct 2010 11:19:09 +0530
changeset 333 91b427241f8f
parent 290 290f3e62dc44
permissions -rw-r--r--
Finished sets
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
290
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
     1
#+LaTeX_CLASS: beamer
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
     2
#+LaTeX_CLASS_OPTIONS: [presentation]
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
     3
#+BEAMER_FRAME_LEVEL: 1
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
     4
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
     5
#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
     6
#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
     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
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
     8
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
     9
#+LaTeX_CLASS: beamer
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    10
#+LaTeX_CLASS_OPTIONS: [presentation]
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    11
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    12
#+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    13
#+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    14
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    15
#+LaTeX_HEADER: \usepackage{listings}
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    16
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    17
#+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    18
#+LaTeX_HEADER:  commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    19
#+LaTeX_HEADER:  showstringspaces=false, keywordstyle=\color{blue}\bfseries}
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    20
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    21
#+TITLE: Savefig
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    22
#+AUTHOR: FOSSEE
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    23
#+EMAIL: info@fossee.in    
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    24
#+DATE: 2010-10-11 Mon
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    25
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    26
#+DESCRIPTION: 
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    27
#+KEYWORDS: 
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    28
#+LANGUAGE:  en
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    29
#+OPTIONS:   H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    30
#+OPTIONS:   TeX:t LaTeX:nil skip:nil d:nil todo:nil pri:nil tags:not-in-toc
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    31
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    32
* Outline
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    33
  - Saving plots.
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    34
  - Plotting in different formats.
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    35
  - Locating the file in the file system.
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    36
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    37
* Creating a basic plot
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    38
  Plot a sine wave from -3pi to 3pi.
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    39
  #+begin_src python
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    40
    In []: x = linspace(-3*pi,3*pi,100)
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    41
    
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    42
    In []: plot(x, sin(x))
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    43
  #+end_src
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    44
* savefig()
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    45
** savefig() - to save plots
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    46
   : syntax: savefig(fname)
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    47
** example
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    48
*** savefig('/home/fossee/sine.png')    
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    49
   - file sine.png saved to the folder /home/fossee
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    50
   - .png - file type
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    51
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    52
* More on savefig()
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    53
** Recall
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    54
   - .png - file type
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    55
** File types supported
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    56
*** .pdf - PDF(Portable Document Format)
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    57
*** .ps - PS(Post Script)
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    58
*** .eps - Encapsulated Post Script
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    59
    ~to be used with~ LaTeX ~documents~
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    60
*** .svg - Scalable Vector Graphics
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    61
    ~vector graphics~
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    62
*** .png - Portable Network Graphics
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    63
    ~supports transparency~
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    64
* Exercise 1
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    65
  Save the sine plot in the format EPS which can be embedded in LaTeX documents.
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    66
* Solution 1
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    67
  #+begin_src python
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    68
    savefig('/home/fossee/sine.eps')
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    69
  #+end_src
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    70
* Exercise 2
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    71
  Save the sine plot in PDF, PS and SVG formats.
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    72
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    73
* Summary
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    74
  You should now be able to
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    75
  - Use ~savefig()~ function
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    76
  - Save plots in different formats
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    77
      - PDF
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    78
      - PS
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    79
      - PNG
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    80
      -	SVG
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    81
      - EPS
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    82
  - Locating the files in file system.
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    83
    
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    84
* Thank you!
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    85
#+begin_latex
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    86
  \begin{block}{}
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    87
  \begin{center}
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    88
  This spoken tutorial has been produced by the
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    89
  \textcolor{blue}{FOSSEE} team, which is funded by the 
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    90
  \end{center}
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    91
  \begin{center}
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    92
    \textcolor{blue}{National Mission on Education through \\
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    93
      Information \& Communication Technology \\ 
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    94
      MHRD, Govt. of India}.
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    95
  \end{center}  
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    96
  \end{block}
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    97
#+end_latex
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    98
290f3e62dc44 added slides for savefig.
anoop
parents:
diff changeset
    99