diff options
-rw-r--r-- | getting_started_with_ipython/slides.tex | 2 | ||||
-rw-r--r-- | multiple_plots/script.rst | 493 | ||||
-rw-r--r-- | multiple_plots/slides.org | 99 | ||||
-rw-r--r-- | multiple_plots/slides.tex | 143 | ||||
-rw-r--r-- | using_plot_interactively/slides.org | 41 |
5 files changed, 427 insertions, 351 deletions
diff --git a/getting_started_with_ipython/slides.tex b/getting_started_with_ipython/slides.tex index d48224d..f9be7b9 100644 --- a/getting_started_with_ipython/slides.tex +++ b/getting_started_with_ipython/slides.tex @@ -182,7 +182,7 @@ In this tutorial, we have learnt to -- \begin{itemize} \item False \vspace*{10pt} -\item Ctrl + C +\item Ctrl + D \vspace*{10pt} \item ? \end{itemize} diff --git a/multiple_plots/script.rst b/multiple_plots/script.rst index cc34e97..b31628f 100644 --- a/multiple_plots/script.rst +++ b/multiple_plots/script.rst @@ -16,237 +16,316 @@ Script ------ -At the end of this tutorial you will be able to +.. L1 -1. draw multiple plots which are overlaid. -#. use the figure command. -#. use the legend command -#. switch between the plots and perform some operations on each of them like - saving the plots. -#. create and switch between subplots - -{{{ Show the slide containing the title }}} +{{{ Show the first slide containing title, name of the production +team along with the logo of MHRD }}} + +.. R1 + +Hello friends and Welcome to this spoken tutorial on "Multiple plots". -Hello friends. Welcome to this spoken tutorial on Multiple plots. +.. L2 -{{{ Show the slide containing the outline }}} +{{{ Show slide with objectives }}} -In this tutorial, we will learn how to draw more than one plot, how to -add legends to each plot to indicate what each plot represents. We -will also learn how to switch between the plots and create multiple -plots with different regular axes which are also called as subplots. +.. R2 -.. #[Nishanth]: See diff - edited a grammatical mistake -.. #[Madhu: Done] +At the end of this tutorial, you will be able to, + + 1. draw multiple plots which are overlaid. + #. use the figure command. + #. use the legend command + #. switch between the plots and perform some operations on each of them like + saving the plots. + #. create and switch between subplots + +.. R3 + +To begin with let us start ipython with pylab, by typing ipython -pylab +on the terminal. + +.. L3 {{{ Shift to terminal and start ipython -pylab }}} -To begin with let us start ipython with pylab, by typing:: +:: - ipython -pylab + ipython -pylab -on the terminal +.. R4 Let us first create set of points for our plot. For this we will use -the command called linspace:: +the command called linspace + +.. L4 - x = linspace(0, 50, 10) +:: + + x = linspace(0, 50, 10) + +.. R5 linspace command creates 10 points in the interval between 0 and 50 both inclusive. We assign these values to a variable called x. -.. #[Nishanth]: pre requisite for this LO is basic plotting which - covers linspace and plot. So you may not need to - specify all that again. But not a problem if it is - there also. -.. #[Madhu: Since I thought the LOs are disconnected, I thought it is - better to give a very short intro to it] +Now let us draw a simple sine plot using these points + +.. L5 -Now let us draw a plot simple sine plot using these points:: +:: - plot(x, sin(x)) + plot(x, sin(x)) -This should give us a nice sine plot. +.. L6 {{{ Switch to the plot window }}} -Oh! wait! Is that a nice sine plot? Does a sine plot actually look +.. R6 + +Oh! wait! Is that a good sine plot? Does a sine plot actually look like that? We know that a sine plot is a smooth curve. Is it not? What really caused this? -.. #[Nishanth]: See diff -.. #[Madhu: Done] +.. L7 {{{ pause for a while }}} +.. R7 + A small investigation on linspace tells us that we chose too few points in a large interval between 0 and 50 for the curve to be -smooth. This should also indicate that the plot command actually plots +smooth. This also indicates that the plot command actually plots the set of points given by x and sin(x) and it doesn't plot the -analytical function itself i.e. it plots the points given by +analytical function itself rather it plots the points given by Analytical functions. So now let us use linspace again to get 500 -points between 0 and 100 and draw the sine plot +points between 0 and 100 and draw the sine plot again. + +.. L8 -.. #[Nishanth]: Here specify that when we do plot(x, sin(x) - it is actually plotting two sets of points - and not analytical functions. Hence the sharp - curve. -.. #[Madhu: Incorporated] +{{{ Switch to terminal and type }}} -{{{ Switch to ipython andtype }}} :: +:: - y = linspace(0, 50, 500) - plot(y, sin(y)) + y = linspace(0, 50, 500) + plot(y, sin(y)) -{{{ Change to the plot window }}} +{{{ Switch to the plot window }}} + +.. R8 -Now we see what we remember as a sine plot. A smooth curve. If we +Now we see a sine plot with a smooth curve, just as we wanted.If we carefully notice we also have two plots now one overlaid upon another. In pylab, by default all the plots are overlaid. Since we have two plots now overlaid upon each other we would like to have a way to indicate what each plot represents to distinguish between them. This is accomplished using legends. Equivalently, the -legend command does this for us +legend command does this for us. + +.. L9 -{{{ Switch to ipython }}}:: +{{{ Switch to terminal }}} - legend(['sin(x)', 'cos(x)']) +:: -.. #[Nishanth]: This legend may go up in the script. May be before - introducing the figure command itself. -.. #[Madhu: brought up] + legend(['sin(x)', 'cos(x)']) + +.. R9 The legend command takes a single list of parameters where each parameter is the text indicating the plots in the order of their serial number. +.. L10 + {{{ Switch to plot window }}} +.. R10 + Now we can see the legends being displayed for the respective sine and cosine plots on the plot area. We have learnt quite a lot of things now, so let us take up an -exercise problem. +exercise.Pause the video here and do the exercise. -%% 1 %% Draw two plots overlaid upon each other, with the first plot + Draw two plots overlaid upon each other, with the first plot being a parabola of the form y = 4(x ^ 2) and the second being a straight line of the form y = 2x + 3 in the interval -5 to 5. Use colors to differentiate between the plots and use legends to indicate what each plot is doing. +.. L11 + {{{ pause for a while and continue from paused state }}} +.. R11 + +.. R12 + We can obtain the two plots in different colors using the following -commands:: +commands - x = linspace(-5, 5, 100) - plot(x, 4 * (x * x), 'b') - plot(x, (2 * x) + 3, 'g') +.. L12 -Now we can use the legend command as:: +:: - legend(['Parabola', 'Straight Line']) + x = linspace(-5, 5, 100) + plot(x, 4 * (x * x), 'b') + plot(x, (2 * x) + 3, 'g') -Or we can also just give the equations of the plot:: +.. R13 - legend(['y = 4(x ^ 2)', 'y = 2x + 3']) +Now we can use the legend command as + +.. L13 + +:: + + legend(['Parabola', 'Straight Line']) + +.. R14 + +Or we can also just give the equations of the plot + +.. L14 + +:: + + legend(['y = 4(x ^ 2)', 'y = 2x + 3']) + +.. R15 We now know how to draw multiple plots and use legends to indicate which plot represents what function, but we would like to have more control over the plots we draw. Like switch between them, perform some -operations or labelling on them individually and so on. Let us see how -to accomplish this. Before we move on, let us clear our screen. +operations or labelling them individually and so on. Let us see how +to accomplish this.But before we move on, let us clear our screen. + +.. L15 -{{{ Switch to ipython }}}:: +{{{ Switch to terminal }}} - clf() +:: + + clf() + +.. R16 To accomplishing more control over individual plots we use the figure -command:: +command + +.. L16 - x = linspace(0, 50, 500) - figure(1) - plot(x, sin(x), 'b') - figure(2) - plot(x, cos(x), 'g') +:: + + x = linspace(0, 50, 500) + figure(1) + plot(x, sin(x), 'b') + figure(2) + plot(x, cos(x), 'g') + +.. L17 {{{ Switch to plot window }}} +.. R17 + Now we have two plots, a sine plot and a cosine plot in two different figures. -.. #[Nishanth]: figure(1) and figure(2) give two different plots. - The remaining script moves on the fact that they - give overlaid plots which is not the case. - So clear the figure and plot cos and sin without - introducing figure command. Then introduce legend - and finish off the everything on legend. - Then introduce figure command. +.. L18 -.. #[Madhu: I have just moved up the text about legend command. I - think that should take care of what you suggested. If there is - some mistake with it, Punch please let me know in your next - review.] +{{{ Show both plot window and terminal side by side }}} -{{{ Have both plot window and ipython side by side }}} +.. R18 The figure command takes an integer as an argument which is the serial number of the plot. This selects the corresponding plot. All the plot -commands we run after this are applied to the selected plot. In this -example figure 1 is the sine plot and figure 2 is the cosine plot. We -can, for example, save each plot separately +commands we run hereafter are applied to the selected plot. In this +example figure 1 is the sine plot and figure 2 is the cosine plot.For example,we can +save each plot separately + +.. L19 + +{{{ Switch to terminal }}} -{{{ Switch to ipython }}}:: +:: - savefig('/home/user/cosine.png') - figure(1) - title('sin(y)') - savefig('/home/user/sine.png') + savefig('/home/user/cosine.png') + figure(1) + title('sin(y)') + savefig('/home/user/sine.png') {{{ Have both plot window and ipython side by side }}} +.. R19 + We also titled our first plot as 'sin(y)' which we did not do for the second plot. -Let us attempt another exercise problem +.. R20 + +Let us attempt another exercise problem.Pause here and try to solve the problem -%% 2 %% Draw a line of the form y = x as one figure and another line + Draw a line of the form y = x as one figure and another line of the form y = 2x + 3. Switch back to the first figure, annotate the x and y intercepts. Now switch to the second figure and annotate its x and y intercepts. Save each of them. +.. L20 + {{{ Pause for a while and continue from the paused state }}} +.. R21 + To solve this problem we should first create the first figure using the figure command. Before that, let us first run clf command to make -sure all the previous plots are cleared:: +sure all the previous plots are cleared + +.. L21 + +:: - clf() - figure(1) - x = linspace(-5, 5, 100) - plot(x, x) + clf() + figure(1) + x = linspace(-5, 5, 100) + plot(x, x) -Now we can use figure command to create second plotting area and plot -the figure:: +.. R22 - figure(2) - plot(x, ((2 * x) + 3)) +Now use the figure command to create second plotting area and plot +the figure -Now to switch between the figures we can use figure command. So let us +.. L22 + +:: + + figure(2) + plot(x, ((2 * x) + 3)) + +.. R23 + +Now to switch between the figures we can use figure command. So let us now switch to figure 1. We are asked to annotate x and y intercepts of the -figure 1 but since figure 1 passes through origin we will have to +figure 1, but since figure 1 passes through origin,this means, we will have to annotate the origin. We will annotate the intercepts for the second -figure and save them as follows:: +figure and save them as follows + +.. L23 + +:: + + figure(1) + annotate('Origin', xy=(0.0, 0.0) + figure(2) + annotate('x-intercept', xy=(0, 3)) + annotate('y-intercept', xy=(0, -1.5)) + savefig('/home/fossee/plot2.png') + figure(1) + savefig('/home/fossee/plot1.png') - figure(1) - annotate('Origin', xy=(0.0, 0.0) - figure(2) - annotate('x-intercept', xy=(0, 3)) - annotate('y-intercept', xy=(0, -1.5)) - savefig('/home/fossee/plot2.png') - figure(1) - savefig('/home/fossee/plot1.png') +.. R24 At times we run into situations where we want to compare two plots and in such cases we want to draw both the plots in the same plotting @@ -256,15 +335,20 @@ draw subplots. We use subplot command to accomplish this -{{{ Switch to ipython }}}:: +.. L24 - subplot(2, 1, 1) +{{{ Switch to terminal }}} -subplot command takes three arguments, the first being the number of -rows of subplots that must be created, +:: + + subplot(2, 1, 1) {{{ Have both plot window and ipython side by side }}} +.. R25 + +As we can see subplot command takes three arguments, the first being the number of +rows of subplots that must be created, in this case we have 2 as the first argument so it spilts the plotting area horizontally for two subplots. The second argument specifies the number of coloumns of subplots that must be created. We passed 1 as the argument so the @@ -273,69 +357,107 @@ specifies what subplot must be created now in the order of the serial number. In this case we passed 1 as the argument, so the first subplot that is top half is created. If we execute the subplot command as -{{{ Switch to ipython }}}:: +.. L25 + +{{{ Switch to terminal }}} + +:: - subplot(2, 1, 2) + subplot(2, 1, 2) {{{ Switch to plot window }}} +.. R26 + The lower subplot is created. Now we can draw plots in each of the subplot area using the plot command. -{{{ Switch to ipython }}}:: +.. L26 + +{{{ Switch to ipython }}} + +:: - x = linspace(0, 50, 500) - plot(x, cos(x)) - subplot(2, 1, 1) - y = linspace(0, 5, 100) - plot(y, y ** 2) + x = linspace(0, 50, 500) + plot(x, cos(x)) + subplot(2, 1, 1) + y = linspace(0, 5, 100) + plot(y, y ** 2) +.. L27 + {{{ Have both plot window and ipython side by side }}} +.. R27 + This created two plots one in each of the subplot area. The top subplot holds a parabola and the bottom subplot holds a cosine curve. -As seen here we can use subplot command to switch between the subplot +As seen here we can use subplot command to switch between the subplots as well, but we have to use the same arguments as we used to create that subplot, otherwise the previous subplot at that place will be automatically erased. It is clear from the two subplots that both have different regular axes. For the cosine plot x-axis varies from 0 to 100 and y-axis varies from 0 to 1 where as for the parabolic plot the -x-axis varies from 0 to 10 and y-axis varies from 0 to 100 +x-axis varies from 0 to 10 and y-axis varies from 0 to 100. + +.. R28 -.. #[Nishanth]: stress on the similarity between subplot and figure - commands +Let us try one more exercise.Please pause here. -.. #[Madhu: I think they are not really similar. Trying to bring in - the similarity will confuse people I think.] + We know that the Pressure, Volume and Temperatures are held by + the equation PV = nRT where nR is a constant. Let us assume nR = .01 + Joules/Kelvin and T = 200K. V can be in the range from 21cc to + 100cc. Draw two different plots as subplots, one being the Pressure + versus Volume plot and the other being Pressure versus Temparature + plot. -%% 3 %% We know that the Pressure, Volume and Temperatures are held by -the equation PV = nRT where nR is a constant. Let us assume nR = .01 -Joules/Kelvin and T = 200K. V can be in the range from 21cc to -100cc. Draw two different plots as subplots, one being the Pressure -versus Volume plot and the other being Pressure versus Temparature -plot. +.. L28 + +.. L29 {{{ Pause for a while and continue }}} +.. R29 + +.. R30 + To start with, we have been given the range of Volume using which we -can define the variable V:: +can define the variable V + +.. L30 + +:: + + V = linspace(21, 100, 500) - V = linspace(21, 100, 500) +.. R31 Now we can create first subplot and draw Pressure versus Volume graph using this V. We know that nRT is a constant which is equal to 2.0 -since nR = 0.01 Joules/Kelvin and T = 200 Kelvin:: +since nR = 0.01 Joules/Kelvin and T = 200 Kelvin - subplot(2, 1, 1) - plot(V, 2.0/V) +.. L31 + +:: + + subplot(2, 1, 1) + plot(V, 2.0/V) + +.. R32 Now we can create the second subplot and draw the Pressure versus -Temparature plot as follows:: +Temparature plot as follows + +.. L32 + +:: + + subplot(2, 1, 2) + plot(200, 2.0/V) - subplot(2, 1, 2) - plot(200, 2.0/V) +.. R33 Unfortunately we have an error now, telling x and y dimensions don't match. This is because our V contains a set of values as returned by @@ -343,41 +465,74 @@ linspace and hence 2.0/V which is the pressure also contains a set of values. But the first argument to the plot command is a single value. So to plot this data we need to create as many points as there are in Pressure or Volume data for Temperature too, all having the -same value. This can be accomplished using:: +same value.Hence we do this, - T = linspace(200, 200, 500) +.. L33 + +:: + + T = linspace(200, 200, 500) + +.. R34 We now have 500 values in T each with the value 200 Kelvin. Plotting -this data we get the required plot:: +this data, we get the required plot - plot(T, 2.0/V) +.. L34 -It is left as a homework to label both X and Y axes for each of the -two subplots. +:: + plot(T, 2.0/V) + +.. L35 + {{{ Show summary slide }}} -.. #[Nishanth]: Exercises are missing in the script - one exercise for overlaid plot and legend - one for figure command - one for subplot must do +.. R35 + +This brings us to the end of another session.let's revise quickly what we have learnt today, + + 1. to draw multiple plots which are overlaid. + #. to use the figure command. + #. to use the legend command. + #. to switch between the plots and perform some operations on each + of them like saving the plots. + #. to create subplots and to switch between them. + +.. L36 + +{{Show self assessment questions slide}} + +.. R36 + +Here are some self assessment questions for you to solve + +1. What command is used to get individual plots separately?. + +2. Which of the following is correct. + + - subplot(numRows, numCols, plotNum) + - subplot(numRows, numCols) + - subplot(numCols, numRows) + +.. L37 + +(solution of self assessment questions on slide) + +.. R37 + +And the answers, -This brings us to the end of another session. In this tutorial session -we learnt +1. The command "figure" can get us the individual plots seperately. - * How to draw multiple plots which are overlaid - * the figure command - * the legend command - * how to switch between the plots and perform some operations on each - of them like saving the plots and - * creating and switching between subplots +2. The subplot command takes three arguments namely the number of rows followed by the + the number of columns and the plot number.Hence the first option is correct. -.. #[Nishanth]: legend command can be told right after overlaid plots -.. #[Madhu: Incorporated] +.. L38 -{{{ Show the "sponsored by FOSSEE" slide }}} +{{{ a thank you slide }}} -This tutorial was created as a part of FOSSEE project, NME ICT, MHRD India +.. R38 Hope you have enjoyed and found it useful. Thank you! diff --git a/multiple_plots/slides.org b/multiple_plots/slides.org index 5d2ce93..1a9aee8 100644 --- a/multiple_plots/slides.org +++ b/multiple_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: Accessing parts of arrays +#+TITLE: Multiple Plots #+AUTHOR: FOSSEE #+EMAIL: #+DATE: @@ -29,95 +29,30 @@ #+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 - - Manipulating one and multi dimensional arrays - - Access and change individual elements - - Access and change rows and columns - - Slicing and striding on arrays to access chunks - - Read images into arrays and manipulations -* Sample Arrays - #+begin_src python - In []: A = array([12, 23, 34, 45, 56]) - - In []: C = array([[11, 12, 13, 14, 15], - [21, 22, 23, 24, 25], - [31, 32, 33, 34, 35], - [41, 42, 43, 44, 45], - [51, 52, 53, 54, 55]]) - - #+end_src -* Question 1 - Change the last column of ~C~ to zeroes. -* Solution 1 - #+begin_src python - In []: C[:, -1] = 0 - #+end_src -* Question 2 - Change ~A~ to ~[11, 12, 13, 14, 15]~. -* Solution 2 - #+begin_src python - In []: A[:] = [11, 12, 13, 14, 15] - #+end_src -* squares.png - #+begin_latex - \begin{center} - \includegraphics[scale=0.6]{squares} - \end{center} - #+end_latex -* Question 3 - - obtain ~[22, 23]~ from ~C~. - - obtain ~[11, 21, 31, 41]~ from ~C~. - - obtain ~[21, 31, 41, 0]~. -* Solution 3 - #+begin_src python - In []: C[1, 1:3] - In []: C[0:4, 0] - In []: C[1:5, 0] - #+end_src -* Question 4 - Obtain ~[[23, 24], [33, -34]]~ from ~C~ -* Solution 4 - #+begin_src python - In []: C[1:3, 2:4] - #+end_src -* Question 5 - Obtain the square in the center of the image -* Solution 5 - #+begin_src python - In []: imshow(I[75:225, 75:225]) - #+end_src -* Question 6 - Obtain the following - #+begin_src python - [[12, 0], [42, 0]] - [[12, 13, 14], [0, 0, 0]] - #+end_src -* Solution 6 - #+begin_src python - In []: C[::3, 1::3] - In []: C[::4, 1:4] - #+end_src -* Summary - You should now be able to -- - - Manipulate 1D \& Multi dimensional arrays - - Access and change individual elements - - Access and change rows and columns - - Slice and stride on arrays - - Read images into arrays and manipulate them. -* Thank you! +* Objective + At the end of this tutorial you will be able to + - draw multiple plots which are overlaid + - use the figure command + - use the legend command + - switch between the plots and perform some operations on each of them like + saving the plots. + - create and switch between subplots + +* 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/multiple_plots/slides.tex b/multiple_plots/slides.tex index df1462c..7498504 100644 --- a/multiple_plots/slides.tex +++ b/multiple_plots/slides.tex @@ -1,106 +1,77 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%Tutorial slides on Python. -% -% Author: FOSSEE -% Copyright (c) 2009, FOSSEE, IIT Bombay -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\documentclass[14pt,compress]{beamer} -%\documentclass[draft]{beamer} -%\documentclass[compress,handout]{beamer} -%\usepackage{pgfpages} -%\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm] - -% Modified from: generic-ornate-15min-45min.de.tex -\mode<presentation> -{ - \usetheme{Warsaw} - \useoutertheme{infolines} - \setbeamercovered{transparent} -} - -\usepackage[english]{babel} +% Created 2011-04-27 Wed 16:40 +\documentclass[presentation]{beamer} \usepackage[latin1]{inputenc} -%\usepackage{times} \usepackage[T1]{fontenc} - -\usepackage{ae,aecompl} -\usepackage{mathpazo,courier,euler} -\usepackage[scaled=.95]{helvet} - -\definecolor{darkgreen}{rgb}{0,0.5,0} - +\usepackage{fixltx2e} +\usepackage{graphicx} +\usepackage{longtable} +\usepackage{float} +\usepackage{wrapfig} +\usepackage{soul} +\usepackage{textcomp} +\usepackage{marvosym} +\usepackage{wasysym} +\usepackage{latexsym} +\usepackage{amssymb} +\usepackage{hyperref} +\tolerance=1000 +\usepackage[english]{babel} \usepackage{ae,aecompl} +\usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet} \usepackage{listings} -\lstset{language=Python, - basicstyle=\ttfamily\bfseries, - commentstyle=\color{red}\itshape, - stringstyle=\color{darkgreen}, - showstringspaces=false, - keywordstyle=\color{blue}\bfseries} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Macros -\setbeamercolor{emphbar}{bg=blue!20, fg=black} -\newcommand{\emphbar}[1] -{\begin{beamercolorbox}[rounded=true]{emphbar} - {#1} - \end{beamercolorbox} -} -\newcounter{time} -\setcounter{time}{0} -\newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}} - -\newcommand{\typ}[1]{\lstinline{#1}} - -\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}} } - -% Title page -\title{Your Title Here} - -\author[FOSSEE] {FOSSEE} - -\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay} +\lstset{language=Python, basicstyle=\ttfamily\bfseries, +commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen}, +showstringspaces=false, keywordstyle=\color{blue}\bfseries} +\providecommand{\alert}[1]{\textbf{#1}} + +\title{Multiple Plots} +\author{FOSSEE} \date{} -% DOCUMENT STARTS +\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent} \begin{document} -\begin{frame} - \maketitle -\end{frame} +\maketitle + + + + + + -\begin{frame}[fragile] - \frametitle{Outline} - \begin{itemize} - \item - \end{itemize} -\end{frame} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% All other slides here. %% -%% The same slides will be used in a classroom setting. %% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\begin{frame}[fragile] - \frametitle{Summary} - \begin{itemize} - \item - \end{itemize} -\end{frame} \begin{frame} - \frametitle{Thank you!} +\frametitle{Objective} +\label{sec-1} + + At the end of this tutorial you will be able to + +\begin{itemize} +\item draw multiple plots which are overlaid +\item use the figure command +\item use the legend command +\item switch between the plots and perform some operations on each of them like + saving the plots. +\item create and switch between subplots +\end{itemize} +\end{frame} +\begin{frame} +\frametitle{Acknowledgement} +\label{sec-2} + \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 diff --git a/using_plot_interactively/slides.org b/using_plot_interactively/slides.org index ca0ff12..1716c83 100644 --- a/using_plot_interactively/slides.org +++ b/using_plot_interactively/slides.org @@ -29,9 +29,10 @@ #+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 - - Plot a simple mathemaical function. - - Using the User Interface of plot figure. +* Objectives + At the end of this tutorial, you will be able to, + - Create simple plots of mathematical functions. + - Use the Figure window to study plots better. * Error if Ipython not installed @@ -48,27 +49,41 @@ - Back and Forward Button - Home - + * Summary - - Plotting mathematical functions using plot. - - Using the UI of plot + In this tutorial,we have learnt to- + - Start Ipython with pylab. + - Use the linspace function to create `num` equally spaced points in a region. + - Find the length of sequnces using len function. + - Plot mathematical functions using plot. + - Clear drawing area using clf. + - Plott mathematical functions using plot. + - Use the UI of plot - Save - Zoom - Move axis - Back and Forward Button - Home -* Thank You! +* Evaluation + 1. Create 100 equally spaced points between -pi/2 and pi/2? + 2. How do you clear a figure in ipython? + 3. How do find the length of a sequen +* Solutions... + 1. linspace(-pi/2,pi/2,100) + 2. clf() + 3. len(sequence\_name) +* Acknowledgement... #+begin_latex - \begin{block}{} + \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_latex |