290
|
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: Savefig
|
|
22 |
#+AUTHOR: FOSSEE
|
|
23 |
#+EMAIL: info@fossee.in
|
|
24 |
#+DATE: 2010-10-11 Mon
|
|
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 |
- Saving plots.
|
|
34 |
- Plotting in different formats.
|
|
35 |
- Locating the file in the file system.
|
|
36 |
|
|
37 |
* Creating a basic plot
|
|
38 |
Plot a sine wave from -3pi to 3pi.
|
|
39 |
#+begin_src python
|
|
40 |
In []: x = linspace(-3*pi,3*pi,100)
|
|
41 |
|
|
42 |
In []: plot(x, sin(x))
|
|
43 |
#+end_src
|
|
44 |
* savefig()
|
|
45 |
** savefig() - to save plots
|
|
46 |
: syntax: savefig(fname)
|
|
47 |
** example
|
|
48 |
*** savefig('/home/fossee/sine.png')
|
|
49 |
- file sine.png saved to the folder /home/fossee
|
|
50 |
- .png - file type
|
|
51 |
|
|
52 |
* More on savefig()
|
|
53 |
** Recall
|
|
54 |
- .png - file type
|
|
55 |
** File types supported
|
|
56 |
*** .pdf - PDF(Portable Document Format)
|
|
57 |
*** .ps - PS(Post Script)
|
|
58 |
*** .eps - Encapsulated Post Script
|
|
59 |
~to be used with~ LaTeX ~documents~
|
|
60 |
*** .svg - Scalable Vector Graphics
|
|
61 |
~vector graphics~
|
|
62 |
*** .png - Portable Network Graphics
|
|
63 |
~supports transparency~
|
|
64 |
* Exercise 1
|
|
65 |
Save the sine plot in the format EPS which can be embedded in LaTeX documents.
|
|
66 |
* Solution 1
|
|
67 |
#+begin_src python
|
|
68 |
savefig('/home/fossee/sine.eps')
|
|
69 |
#+end_src
|
|
70 |
* Exercise 2
|
|
71 |
Save the sine plot in PDF, PS and SVG formats.
|
|
72 |
|
|
73 |
* Summary
|
|
74 |
You should now be able to
|
|
75 |
- Use ~savefig()~ function
|
|
76 |
- Save plots in different formats
|
|
77 |
- PDF
|
|
78 |
- PS
|
|
79 |
- PNG
|
|
80 |
- SVG
|
|
81 |
- EPS
|
|
82 |
- Locating the files in file system.
|
|
83 |
|
|
84 |
* Thank you!
|
|
85 |
#+begin_latex
|
|
86 |
\begin{block}{}
|
|
87 |
\begin{center}
|
|
88 |
This spoken tutorial has been produced by the
|
|
89 |
\textcolor{blue}{FOSSEE} team, which is funded by the
|
|
90 |
\end{center}
|
|
91 |
\begin{center}
|
|
92 |
\textcolor{blue}{National Mission on Education through \\
|
|
93 |
Information \& Communication Technology \\
|
|
94 |
MHRD, Govt. of India}.
|
|
95 |
\end{center}
|
|
96 |
\end{block}
|
|
97 |
#+end_latex
|
|
98 |
|
|
99 |
|