diff options
Diffstat (limited to 'saving_plots')
-rw-r--r-- | saving_plots/script.rst | 28 | ||||
-rw-r--r-- | saving_plots/slides.org | 59 | ||||
-rw-r--r-- | saving_plots/slides.tex | 125 |
3 files changed, 110 insertions, 102 deletions
diff --git a/saving_plots/script.rst b/saving_plots/script.rst index 7019015..c794690 100644 --- a/saving_plots/script.rst +++ b/saving_plots/script.rst @@ -23,7 +23,7 @@ .. #[Puneeth: Quickref missing.] ======= -Savefig +Script ======= .. L1 @@ -45,21 +45,21 @@ At the end of this tutorial, you will be able to, 1. Save plots using ``savefig()`` function. #. Save plots in different formats. -.. L3 - -{{{ switch to next slide, a sine wave}}} - .. R3 Start your IPython interpreter with the command ipython -pylab -.. L4 +.. L3 :: ipython -pylab +.. L4 + +{{{Switch to slide 'Creating a basic plot'}}} + .. R4 As you know, it will start your IPython interpreter with the required @@ -98,8 +98,6 @@ reports. {{{ switch to next slide, savefig() }}} -{{{ Switch the focus to IPython interpreter window }}} - .. R7 For saving the plot, we will use ``savefig()`` function.For this we shall keep the @@ -107,6 +105,8 @@ plot window open alongside the terminal. The statement is, .. L8 +{{{ Switch the focus to IPython interpreter window }}} + :: savefig('/home/fossee/sine.png') @@ -167,13 +167,11 @@ support transparency etc. .. L13 -{{{ switch to next slide, exercise 1 }}} +{{{ switch to next slide,'exercise 1' }}} .. R13 -Let us now try to save the plot in eps format. ``eps`` stands for -encapsulated post script, and it can be embedded in your latex -documents. Pause here and try to figure it out yourself. +Save the sine plot in the format EPS which can be embedded in LaTeX documents. .. L14 @@ -186,8 +184,6 @@ We still have the sine plot with us, and now let us save the plot as .. L15 -{{{ switch to next slide, solution 1 }}} - {{{ Switch focus to IPython interpreter }}} .. R15 @@ -208,8 +204,8 @@ Now let us go to ``/home/fossee`` and see the new file created. .. L17 -{{{ Highlight the file sine.eps with a single mouse click for 2 -seconds and then double click and open the file }}} +{{{ Highlight the file sine.eps for 2 seconds and + then double click and open the file }}} .. R17 diff --git a/saving_plots/slides.org b/saving_plots/slides.org index 4278516..487f7aa 100644 --- a/saving_plots/slides.org +++ b/saving_plots/slides.org @@ -18,7 +18,7 @@ #+LaTeX_HEADER: commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen}, #+LaTeX_HEADER: showstringspaces=false, keywordstyle=\color{blue}\bfseries} -#+TITLE: Savefig +#+TITLE: #+AUTHOR: FOSSEE #+EMAIL: info@fossee.in #+DATE: 2010-10-11 Mon @@ -29,11 +29,24 @@ #+OPTIONS: H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:nil pri:nil tags:not-in-toc -* Outline - - Saving plots. - - Plotting in different formats. - - Locating the file in the file system. +* +#+begin_latex +\begin{center} +\textcolor{blue}{Saving Plots} +\end{center} +\begin{center} +\includegraphics[scale=0.25]{../images/iitb-logo.png}\\ +Developed by FOSSEE Team, IIT-Bombay. \\ +Funded by National Mission on Education through ICT +MHRD, Govt. of India +\end{center} +#+end_latex +* Objectives + At the end of this tutorial, you will be able to, + - Save plots using ``savefig()`` function. + - Save plots in different formats. + * Creating a basic plot Plot a sine wave from -3pi to 3pi. #+begin_src python @@ -63,37 +76,33 @@ ~supports transparency~ * Exercise 1 Save the sine plot in the format EPS which can be embedded in LaTeX documents. -* Solution 1 - #+begin_src python - savefig('/home/fossee/sine.eps') - #+end_src * Exercise 2 Save the sine plot in PDF, PS and SVG formats. * Summary - You should now be able to - - Use ~savefig()~ function - - Save plots in different formats - - PDF - - PS - - PNG - - SVG - - EPS - - Locating the files in file system. - -* Thank you! + In this tutorial, we have learnt to – + - Save plots using the ``savefig()`` function. + - Save the plots in differnt formats. + - pdf + - ps + - png + - svg + - epg + - Locate files in the file system. +* Acknowledgement #+begin_latex \begin{block}{} \begin{center} - This spoken tutorial has been produced by the - \textcolor{blue}{FOSSEE} team, which is funded by the + \textcolor{blue}{\Large THANK YOU!} \end{center} + \end{block} +\begin{block}{} \begin{center} - \textcolor{blue}{National Mission on Education through \\ - Information \& Communication Technology \\ - MHRD, Govt. of India}. + For more Information, visit our website\\ + \url{http://fossee.in/} \end{center} \end{block} +\end{frame} #+end_latex diff --git a/saving_plots/slides.tex b/saving_plots/slides.tex index 06d530b..5e37bc2 100644 --- a/saving_plots/slides.tex +++ b/saving_plots/slides.tex @@ -1,6 +1,6 @@ -% Created 2010-10-11 Mon 17:08 +% Created 2011-05-03 Tue 14:50 \documentclass[presentation]{beamer} -\usepackage[latin1]{inputenc} +\usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{fixltx2e} \usepackage{graphicx} @@ -8,7 +8,6 @@ \usepackage{float} \usepackage{wrapfig} \usepackage{soul} -\usepackage{t1enc} \usepackage{textcomp} \usepackage{marvosym} \usepackage{wasysym} @@ -24,14 +23,13 @@ commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen}, showstringspaces=false, keywordstyle=\color{blue}\bfseries} \providecommand{\alert}[1]{\textbf{#1}} -\title{Savefig} +\title{} \author{FOSSEE} \date{2010-10-11 Mon} \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent} \begin{document} -\maketitle @@ -41,101 +39,108 @@ showstringspaces=false, keywordstyle=\color{blue}\bfseries} + +\begin{frame} + +\begin{center} +\textcolor{blue}{Saving Plots} +\end{center} +\begin{center} +\includegraphics[scale=0.25]{../images/iitb-logo.png}\\ +Developed by FOSSEE Team, IIT-Bombay. \\ +Funded by National Mission on Education through ICT + +MHRD, Govt. of India +\end{center} +\end{frame} \begin{frame} -\frametitle{Outline} -\label{sec-1} +\frametitle{Objectives} +\label{sec-2} + + At the end of this tutorial, you will be able to, \begin{itemize} -\item Saving plots. -\item Plotting in different formats. -\item Locating the file in the file system. +\item Save plots using ``savefig()`` function. +\item Save plots in different formats. \end{itemize} + \end{frame} \begin{frame}[fragile] \frametitle{Creating a basic plot} -\label{sec-2} +\label{sec-3} Plot a sine wave from -3pi to 3pi. -\begin{verbatim} +\lstset{language=Python} +\begin{lstlisting} In []: x = linspace(-3*pi,3*pi,100) In []: plot(x, sin(x)) -\end{verbatim} +\end{lstlisting} \end{frame} \begin{frame}[fragile] \frametitle{savefig()} -\label{sec-3} +\label{sec-4} \begin{itemize} \item savefig() - to save plots -\label{sec-3_1}% +\label{sec-4_1}% \begin{verbatim} syntax: savefig(fname) \end{verbatim} \item example -\label{sec-3_2}% +\label{sec-4_2}% \begin{itemize} -\item savefig('/home/fossee/sine.png') -\label{sec-3_2_1}% +\item savefig('/home/fossee/sine.png')\\ +\label{sec-4_2_1}% \begin{itemize} \item file sine.png saved to the folder /home/fossee \item .png - file type \end{itemize} - \end{itemize} % ends low level \end{itemize} % ends low level \end{frame} \begin{frame} \frametitle{More on savefig()} -\label{sec-4} +\label{sec-5} \begin{itemize} -\item Recall -\label{sec-4_1}% +\item Recall\\ +\label{sec-5_1}% \begin{itemize} \item .png - file type \end{itemize} - \item File types supported -\label{sec-4_2}% +\label{sec-5_2}% \begin{itemize} \item .pdf - PDF(Portable Document Format)\\ -\label{sec-4_2_1}% +\label{sec-5_2_1}% \item .ps - PS(Post Script)\\ -\label{sec-4_2_2}% +\label{sec-5_2_2}% \item .eps - Encapsulated Post Script\\ -\label{sec-4_2_3}% -\texttt{to be used with} \LaTeX{} \texttt{documents} +\label{sec-5_2_3}% +\verb~to be used with~ \LaTeX{} \verb~documents~ \item .svg - Scalable Vector Graphics\\ -\label{sec-4_2_4}% -\texttt{vector graphics} +\label{sec-5_2_4}% +\verb~vector graphics~ \item .png - Portable Network Graphics\\ -\label{sec-4_2_5}% -\texttt{supports transparency} +\label{sec-5_2_5}% +\verb~supports transparency~ \end{itemize} % ends low level \end{itemize} % ends low level \end{frame} \begin{frame} \frametitle{Exercise 1} -\label{sec-5} - - Save the sine plot in the format EPS which can be embedded in \LaTeX{} documents. -\end{frame} -\begin{frame}[fragile] -\frametitle{Solution 1} \label{sec-6} -\begin{verbatim} -savefig('/home/fossee/sine.eps') -\end{verbatim} + Save the sine plot in the format EPS which can be embedded in \LaTeX{} documents. \end{frame} \begin{frame} \frametitle{Exercise 2} @@ -147,39 +152,37 @@ savefig('/home/fossee/sine.eps') \frametitle{Summary} \label{sec-8} - You should now be able to -\begin{itemize} -\item Use \texttt{savefig()} function -\item Save plots in different formats + In this tutorial, we have learnt to – \begin{itemize} -\item PDF -\item PS -\item PNG -\item SVG -\item EPS +\item Save plots using the ``savefig()`` function. +\item Save the plots in differnt formats. +\begin{itemize} +\item pdf +\item ps +\item png +\item svg +\item epg \end{itemize} - -\item Locating the files in file system. +\item Locate files in the file system. \end{itemize} - - \end{frame} \begin{frame} -\frametitle{Thank you!} +\frametitle{Acknowledgement} \label{sec-9} \begin{block}{} \begin{center} - This spoken tutorial has been produced by the - \textcolor{blue}{FOSSEE} team, which is funded by the + \textcolor{blue}{\Large THANK YOU!} \end{center} + \end{block} +\begin{block}{} \begin{center} - \textcolor{blue}{National Mission on Education through \\ - Information \& Communication Technology \\ - MHRD, Govt. of India}. + For more Information, visit our website\\ + \url{http://fossee.in/} \end{center} \end{block} \end{frame} +\end{frame} -\end{document} +\end{document}
\ No newline at end of file |