diff options
author | Jovina | 2011-05-04 12:05:01 +0530 |
---|---|---|
committer | Jovina | 2011-05-04 12:05:01 +0530 |
commit | 8f769af90d747f7e12e4ef64ec2ee9dabf19b727 (patch) | |
tree | 23b5de3ab7c201220de16da2fcbaf6a54e128a0f /multiple_plots | |
parent | 19c8f29fa0be1c8697078fbeae780c5aa52b0676 (diff) | |
download | st-scripts-8f769af90d747f7e12e4ef64ec2ee9dabf19b727.tar.gz st-scripts-8f769af90d747f7e12e4ef64ec2ee9dabf19b727.tar.bz2 st-scripts-8f769af90d747f7e12e4ef64ec2ee9dabf19b727.zip |
Modified files in module1.
Diffstat (limited to 'multiple_plots')
-rw-r--r-- | multiple_plots/script.rst | 69 | ||||
-rw-r--r-- | multiple_plots/slides.org | 46 | ||||
-rw-r--r-- | multiple_plots/slides.tex | 82 |
3 files changed, 155 insertions, 42 deletions
diff --git a/multiple_plots/script.rst b/multiple_plots/script.rst index b31628f..d3dcdfe 100644 --- a/multiple_plots/script.rst +++ b/multiple_plots/script.rst @@ -37,7 +37,7 @@ At the end of this tutorial, you will be able to, #. use the figure command. #. use the legend command #. switch between the plots and perform some operations on each of them like - saving the plots. + saving the plots. #. create and switch between subplots .. R3 @@ -146,8 +146,10 @@ serial number. Now we can see the legends being displayed for the respective sine and cosine plots on the plot area. +.. R11 + We have learnt quite a lot of things now, so let us take up an -exercise.Pause the video here and do the exercise. +exercise.Pause the video here,do the exercise and resume the video. 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 @@ -157,9 +159,8 @@ exercise.Pause the video here and do the exercise. .. L11 -{{{ pause for a while and continue from paused state }}} +{{{ Show slide with question 1 }}} -.. R11 .. R12 @@ -168,6 +169,8 @@ commands .. L12 +{{{ pause for a while and continue from paused state }}} + :: x = linspace(-5, 5, 100) @@ -266,7 +269,7 @@ the second plot. .. R20 -Let us attempt another exercise problem.Pause here and try to solve the problem +Let us attempt another exercise problem.Pause here,try to solve the problem and resume the video. 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 @@ -275,8 +278,8 @@ Let us attempt another exercise problem.Pause here and try to solve the problem .. L20 -{{{ Pause for a while and continue from the paused state }}} - +{{{ Show slide with question 2 }}} + .. R21 To solve this problem we should first create the first figure using @@ -285,6 +288,8 @@ sure all the previous plots are cleared .. L21 +{{{ Pause for a while and continue from the paused state }}} + :: clf() @@ -374,7 +379,7 @@ subplot area using the plot command. .. L26 -{{{ Switch to ipython }}} +{{{ Switch to terminal }}} :: @@ -404,60 +409,58 @@ x-axis varies from 0 to 10 and y-axis varies from 0 to 100. .. R28 -Let us try one more exercise.Please pause here. +Let us try one more exercise.Pause the video here, try out the exercise and resume the video. 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 + the equation PV = nRT where nR is a constant. Let us assume nR =0.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 + versus Volume plot and the other being Pressure versus Temperature plot. .. L28 -.. L29 - -{{{ Pause for a while and continue }}} +{{{ Show slide with question 3 }}} .. R29 -.. R30 - To start with, we have been given the range of Volume using which we can define the variable V -.. L30 +.. L29 + +{{{ Pause for a while and continue }}} :: V = linspace(21, 100, 500) -.. R31 +.. R30 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 -.. L31 +.. L30 :: subplot(2, 1, 1) plot(V, 2.0/V) -.. R32 +.. R31 Now we can create the second subplot and draw the Pressure versus Temparature plot as follows -.. L32 +.. L31 :: subplot(2, 1, 2) plot(200, 2.0/V) -.. R33 +.. R32 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 @@ -467,28 +470,28 @@ 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.Hence we do this, -.. L33 +.. L32 :: T = linspace(200, 200, 500) -.. R34 +.. R33 We now have 500 values in T each with the value 200 Kelvin. Plotting this data, we get the required plot -.. L34 +.. L33 :: plot(T, 2.0/V) -.. L35 +.. L34 {{{ Show summary slide }}} -.. R35 +.. R34 This brings us to the end of another session.let's revise quickly what we have learnt today, @@ -499,11 +502,11 @@ This brings us to the end of another session.let's revise quickly what we have l of them like saving the plots. #. to create subplots and to switch between them. -.. L36 +.. L35 {{Show self assessment questions slide}} -.. R36 +.. R35 Here are some self assessment questions for you to solve @@ -515,11 +518,11 @@ Here are some self assessment questions for you to solve - subplot(numRows, numCols) - subplot(numCols, numRows) -.. L37 +.. L36 (solution of self assessment questions on slide) -.. R37 +.. R36 And the answers, @@ -528,11 +531,11 @@ And the answers, 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. -.. L38 +.. L37 {{{ a thank you slide }}} -.. R38 +.. R37 Hope you have enjoyed and found it useful. Thank you! diff --git a/multiple_plots/slides.org b/multiple_plots/slides.org index 1a9aee8..1dea6b0 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: Multiple Plots +#+TITLE: #+AUTHOR: FOSSEE #+EMAIL: #+DATE: @@ -29,8 +29,21 @@ #+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 +* +#+begin_latex +\begin{center} +\textcolor{blue}{Multiple 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 -* Objective +* Objectives At the end of this tutorial you will be able to - draw multiple plots which are overlaid - use the figure command @@ -39,6 +52,34 @@ saving the plots. - create and switch between subplots +* Question1 + - 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. +* Question2 + - 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. +* Question3 + - We know that the Pressure, Volume and Temperatures are held by + the equation PV = nRT where nR is a constant. Let us assume + nR=0.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 Temperature + plot. +* Summary + In this tutorial, we have learnt 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 subplots and to switch between them. * Acknowledgement #+begin_latex \begin{block}{} @@ -56,3 +97,4 @@ #+end_latex + diff --git a/multiple_plots/slides.tex b/multiple_plots/slides.tex index 7498504..538c6c9 100644 --- a/multiple_plots/slides.tex +++ b/multiple_plots/slides.tex @@ -1,6 +1,6 @@ -% Created 2011-04-27 Wed 16:40 +% Created 2011-05-03 Tue 11:51 \documentclass[presentation]{beamer} -\usepackage[latin1]{inputenc} +\usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{fixltx2e} \usepackage{graphicx} @@ -23,14 +23,13 @@ commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen}, showstringspaces=false, keywordstyle=\color{blue}\bfseries} \providecommand{\alert}[1]{\textbf{#1}} -\title{Multiple Plots} +\title{} \author{FOSSEE} \date{} \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent} \begin{document} -\maketitle @@ -42,8 +41,21 @@ showstringspaces=false, keywordstyle=\color{blue}\bfseries} \begin{frame} -\frametitle{Objective} -\label{sec-1} + +\begin{center} +\textcolor{blue}{Multiple 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{Objectives} +\label{sec-2} At the end of this tutorial you will be able to @@ -57,8 +69,64 @@ showstringspaces=false, keywordstyle=\color{blue}\bfseries} \end{itemize} \end{frame} \begin{frame} +\frametitle{Question1} +\label{sec-3} + + +\begin{itemize} +\item 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. +\item Use colors to differentiate between the plots and use legends to + indicate what each plot is doing. +\end{itemize} +\end{frame} +\begin{frame} +\frametitle{Question2} +\label{sec-4} + + +\begin{itemize} +\item Draw a line of the form y = x as one figure and another line + of the form y = 2x + 3. +\item Switch back to the first figure, annotate the x and y intercepts. +\item Now switch to the second figure and annotate its x and y intercepts. + Save each of them. +\end{itemize} +\end{frame} +\begin{frame} +\frametitle{Question3} +\label{sec-5} + + +\begin{itemize} +\item We know that the Pressure, Volume and Temperatures are held by + the equation PV = nRT where nR is a constant. Let us assume + nR=0.01 Joules/Kelvin and T = 200K. + V can be in the range from 21cc to 100cc. +\item Draw two different plots as subplots, one being the Pressure + versus Volume plot and the other being Pressure versus Temperature + plot. +\end{itemize} +\end{frame} +\begin{frame} +\frametitle{Summary} +\label{sec-6} + + In this tutorial, we have learnt 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 subplots and to switch between them. +\end{itemize} +\end{frame} +\begin{frame} \frametitle{Acknowledgement} -\label{sec-2} +\label{sec-7} \begin{block}{} \begin{center} |