diff options
author | Jovina | 2011-05-19 14:00:45 +0530 |
---|---|---|
committer | Jovina | 2011-05-19 14:00:45 +0530 |
commit | 3fafdde94954b1d4912437d78e1ff2136c51bcce (patch) | |
tree | a605090987ffd752c28858f791f5d65c9634cecf /multiple_plots | |
parent | 8716e3e3490ec77535e28411e0d2e744580745f8 (diff) | |
download | st-scripts-3fafdde94954b1d4912437d78e1ff2136c51bcce.tar.gz st-scripts-3fafdde94954b1d4912437d78e1ff2136c51bcce.tar.bz2 st-scripts-3fafdde94954b1d4912437d78e1ff2136c51bcce.zip |
Minor changes to the scripts & slides in 1st module.
Diffstat (limited to 'multiple_plots')
-rw-r--r-- | multiple_plots/script.rst | 70 | ||||
-rw-r--r-- | multiple_plots/slides.org | 12 | ||||
-rw-r--r-- | multiple_plots/slides.tex | 69 |
3 files changed, 102 insertions, 49 deletions
diff --git a/multiple_plots/script.rst b/multiple_plots/script.rst index d154ca5..0f52808 100644 --- a/multiple_plots/script.rst +++ b/multiple_plots/script.rst @@ -36,17 +36,22 @@ 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. + #. switch between the plots and perform some operations on each of them + like saving the plots. #. create and switch between subplots .. R3 +Before beginning this tutorial,we would suggest you to complete the +tutorial on "Using plot interactively" , "Embellishing a plot" and "Saving plots". + To begin with let us start ipython with pylab, by typing ipython -pylab on the terminal. .. L3 +{{{ Show slide with pre-requisite }}} + {{{ Shift to terminal and start ipython -pylab }}} :: @@ -146,6 +151,10 @@ serial number. Now we can see the legends being displayed for the respective sine and cosine plots on the plot area. +.. L11 + +{{{ Show slide with exercise 1 }}} + .. R11 We have learnt quite a lot of things now, so let us take up an @@ -157,13 +166,9 @@ exercise.Pause the video here,do the exercise and resume the video. colors to differentiate between the plots and use legends to indicate what each plot is doing. -.. L11 - -{{{ Show slide with question 1 }}} - - .. R12 +Switch to the terminal for solution. We can obtain the two plots in different colors using the following commands @@ -246,8 +251,8 @@ figures. 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 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 +example figure 1 is the sine plot and figure 2 is the cosine plot. +For example,we cansave each plot separately .. L19 @@ -269,16 +274,17 @@ the second plot. .. R20 -Let us attempt another exercise problem.Pause here,try to solve the problem and resume the video. +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 + 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 -{{{ Show slide with question 2 }}} +{{{ Show slide with exercise 2 }}} .. R21 @@ -311,11 +317,11 @@ the figure .. 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,this means, we will have to -annotate the origin. We will annotate the intercepts for the second -figure and save them as follows +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,this means, we +will have to annotate the origin. We will annotate the intercepts for +the second figure and save them as follows .. L23 @@ -352,9 +358,9 @@ We use subplot command to accomplish this .. 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 +As we can see subplot command takes three arguments, the first being +the number ofrows 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 plotting area won't be split vertically and the last argument @@ -409,7 +415,8 @@ x-axis varies from 0 to 10 and y-axis varies from 0 to 100. .. R28 -Let us try one more exercise.Pause the video here, try out the exercise and resume the video. +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 =0.01 @@ -420,7 +427,7 @@ Let us try one more exercise.Pause the video here, try out the exercise and resu .. L28 -{{{ Show slide with question 3 }}} +{{{ Show slide with exercise 3 }}} .. R29 @@ -493,14 +500,14 @@ this data, we get the required plot .. R34 -This brings us to the end of another session.let's revise quickly what we have learnt today, +This brings us to the end of this tutorial.In this tutorial,we have learnt to, - 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 + 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. - #. to create subplots and to switch between them. + #. Create subplots and to switch between them. .. L35 @@ -520,7 +527,7 @@ Here are some self assessment questions for you to solve .. L36 -(solution of self assessment questions on slide) +{{{solution of self assessment questions on slide}}} .. R36 @@ -528,8 +535,9 @@ And the answers, 1. The command "figure()" can get us the individual plots seperately. -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. +2. The subplot command takes three arguments namely the number of + rows followed by the number of columns and the plot number. + Hence the first option is correct. .. L37 diff --git a/multiple_plots/slides.org b/multiple_plots/slides.org index a6194a0..7057616 100644 --- a/multiple_plots/slides.org +++ b/multiple_plots/slides.org @@ -56,19 +56,25 @@ saving the plots. - create and switch between subplots -* Question1 +* Pre-requisite + Spoken tutorial on - + - Using plot interactively. + - Embellishing a plot. + - Saving plots. + +* Exercise 1 - 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 +* Exercise 2 - 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 +* Exercise 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=0.01 Joules/Kelvin and T = 200K. diff --git a/multiple_plots/slides.tex b/multiple_plots/slides.tex index 538c6c9..3b472a9 100644 --- a/multiple_plots/slides.tex +++ b/multiple_plots/slides.tex @@ -1,4 +1,4 @@ -% Created 2011-05-03 Tue 11:51 +% Created 2011-05-19 Thu 13:47 \documentclass[presentation]{beamer} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} @@ -43,14 +43,18 @@ showstringspaces=false, keywordstyle=\color{blue}\bfseries} \begin{frame} \begin{center} -\textcolor{blue}{Multiple Plots} +\vspace{12pt} +\textcolor{blue}{\huge Multiple Plots } \end{center} +\vspace{18pt} \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 +\vspace{10pt} +\includegraphics[scale=0.95]{../images/fossee-logo.png}\\ +\vspace{5pt} +\scriptsize Developed by FOSSEE Team, IIT-Bombay. \\ +\scriptsize Funded by National Mission on Education through ICT\\ +\scriptsize MHRD,Govt. of India\\ +\includegraphics[scale=0.30]{../images/iitb-logo.png}\\ \end{center} \end{frame} \begin{frame} @@ -69,9 +73,21 @@ MHRD, Govt. of India \end{itemize} \end{frame} \begin{frame} -\frametitle{Question1} +\frametitle{Pre-requisite} \label{sec-3} + Spoken tutorial on - + +\begin{itemize} +\item Using plot interactively. +\item Embellishing a plot. +\item Saving plots. +\end{itemize} +\end{frame} +\begin{frame} +\frametitle{Exercise 1} +\label{sec-4} + \begin{itemize} \item Draw two plots overlaid upon each other, with the first plot @@ -82,8 +98,8 @@ MHRD, Govt. of India \end{itemize} \end{frame} \begin{frame} -\frametitle{Question2} -\label{sec-4} +\frametitle{Exercise 2} +\label{sec-5} \begin{itemize} @@ -95,8 +111,8 @@ MHRD, Govt. of India \end{itemize} \end{frame} \begin{frame} -\frametitle{Question3} -\label{sec-5} +\frametitle{Exercise 3} +\label{sec-6} \begin{itemize} @@ -111,7 +127,7 @@ MHRD, Govt. of India \end{frame} \begin{frame} \frametitle{Summary} -\label{sec-6} +\label{sec-7} In this tutorial, we have learnt to – @@ -125,8 +141,31 @@ MHRD, Govt. of India \end{itemize} \end{frame} \begin{frame} -\frametitle{Acknowledgement} -\label{sec-7} +\frametitle{Evaluation} +\label{sec-8} + + +\begin{enumerate} +\item What command is used to get individual plots separately?. +\item Which of the following is correct. +\begin{itemize} +\item subplot(numRows, numCols, plotNum) +\item subplot(numRows, numCols) +\item subplot(numCols, numRows) +\end{itemize} +\end{enumerate} +\end{frame} +\begin{frame} +\frametitle{Solutions} +\label{sec-9} + + +\begin{enumerate} +\item figure() +\item subplot(numRows, numCols, plotNum) +\end{enumerate} +\end{frame} +\begin{frame} \begin{block}{} \begin{center} |