Changes to slides of seccond session.
authorShantanu <shantanu@fossee.in>
Thu, 08 Apr 2010 14:32:43 +0530
changeset 27 5712cc7589f9
parent 26 cfc86eea45b4
child 28 1c875f461183
Changes to slides of seccond session.
basic-plot.txt
plotting-files.txt
presentations/basic-plot.tex
--- a/basic-plot.txt	Wed Apr 07 22:11:33 2010 +0530
+++ b/basic-plot.txt	Thu Apr 08 14:32:43 2010 +0530
@@ -11,11 +11,11 @@
 
 I am assuming that both Ipython and Pylab are installed on your system .
 
-*On your terminal type in the command Ipython -pylab
+*On your terminal type in the command
 $ ipython -pylab
 press RETURN
 
-We will first start with the customary Hello world program. print hello world
+We will first start with the customary Hello world program by writing:
 
 In []: print 'hello world'
 
@@ -38,7 +38,7 @@
 oops  I made a mistake . As you can see I made the mistake of not writing command correctly
 and Ipython changed the prompt . To get the old prompt back type crtl-c
 
-In []: x = linspace(0, 2*pi, 50)
+In []: x = linspace(0, 2*pi, 100)
 
 *As you can see linspace can take three parameters start, stop, and num and returns num evenly space points . You can scroll through the help to know more about the function
 
@@ -78,7 +78,7 @@
 
 We have just typed legend command can we reuse it . Yes 
 
-To go to previous command, we can use 'UP Arrow key' and 'DOWN' will take us (in reverse order)/back.
+To go to previous command, we can use 'UP Arrow key' and 'DOWN' will take us back.
 
 We can modify previous command to specify the location of the legend, by passing an additional argument to the function. 
 #Ask madhu how to describe the feature here.
@@ -102,8 +102,8 @@
 In []: savefig('sin.png') saves the figure with the name 'sin.png' in the current directory. 
 
 #other supported formats are: eps, ps, pdf etc.
-When we use plot again by default plots get overlaid.
-In []: plot(x, cos(x))
+When we use plot again 
+In []: plot(x, cos(x)) by default plots get overlaid.
 
 we update Y axis label 
 In []: ylabel('f(x)')
@@ -147,7 +147,7 @@
 close() now closes the figure(2).
 In []: close()
 
-The plot command can take the  parameters such as 'g' which generates the plot in green color. 
+The plot command can take the additional parameters such as 'g' which generates the plot in green color. 
 
 Passing the linewidth=2 option to plot, generates the plot with linewidth of two units.
 Use Up arrow to get to the previous commands 
@@ -169,29 +169,17 @@
 and finally to close the plot
 In []: close()
 
-In this tutorial You learned 
-
-Ipython Features
-Tab for autocompletion.
-function? to look at documention
-q to quit documentation.
-escapping from ... prompt using Ctrl -C
-quitting ipython using Ctrl-D
+In this tutorial we learned 
 
-The functions and commands you learnt were :
-print for outping things
-linspace to create equally space points
-plot to get a plot
-xlabel to label x-axis of plot
-ylabel to label y-axis of plot
-title to title a plot
-legend for placing  appropriate legend
-annotating a plot
-saving a plot
-multiple plots using figure
-clearing plots using clf()
-and last closing plot using close()
+Some IPython Features
+Starting and exiting.
+autocompletion.
+help functionality.
 
+Regarding plotting we covered:
+How to create basic plots.
+Adding labels, legends annotation etc.
+How to change looks of the plot like colors, linewidth formats etc
 
 ****************
 This brings us to the end of this tutorial. This is the first tutorial in a series of tutorials on Python for Scientific Computing. This tutorial is created by the FOSSEE team, IIT Bombay. Hope you enjoyed it and found it useful.
@@ -202,3 +190,4 @@
 ************
 
 Various problems of Ipython, navigation and enter, exit.
+What about xlim and ylim?
--- a/plotting-files.txt	Wed Apr 07 22:11:33 2010 +0530
+++ b/plotting-files.txt	Thu Apr 08 14:32:43 2010 +0530
@@ -1,39 +1,30 @@
 **********************************************************************************
 Hello and welcome, this is the second tutorial in the series of spoken tutorials on Python for Scientific computing. 
 
-Here we will teach you how to plot experimental data, with two variables.  
-
-You could input the data either as a list or read from a plain text/binary file. 
+Here we will teach you how to plot experimental data.
 
-# Before going through this video, you should have a working knowledge of
-#   - Lists
-#   - How to initialize them
-#   - How to append elements to the lists
-#   - ??? for command
-#   - How to iterate over a list
-#   - How to split a command
-#   - The plot command
-#   - How to plot two variables
+You can input the data either as a list or read from a plain text/binary file. We will cover both one by one.
+Please make sure you have pendulum.txt file, as mentioned on requirement list of session
  
 So let's begin.  First we will input the data as lists and then we will plot it. 
-So on the IPython Interpreter we will type
+So on the Interpreter we will type
 x = [0, 1, 2.1, 3.1, 4.2, 5.2]
 here x is a list. In python, list is a container that holds a number of objects. Various functions related to lists will be covered in more detail later. 
 
 Now for the corresponding Y values type
 y = [0, 0.8, 0.9, 0, -0.9, -0.8]
  
-Now we have x and y in two separate lists and we plot x vs. y.
+Now we have x and y in two separate lists and we plot x vs. y via:
 plot (x, y, 'o')
 
 Here, we have our plot! 
 [We close the plot window. ] 
 
-Now, that we know how to plot data from lists, we will look at plotting data from a text file. Essentially, we read the data from the file and massage it into lists again. Then we can easily plot it, as we already did before. 
+Now, that we know how to plot data from lists, we will look at plotting data from a text file. Essentially, we read the data from the file and fit them into lists again. Then we can easily plot it, as we already did before. 
 
-As an example we will use the data collected from a simple pendulum experiment. Please make sure you have pendulum.txt file, as mentioned on requirement page(link)
+As an example we will use the data collected from a simple pendulum experiment. 
 
-In []: cat pendulum.txt (windows?)
+In []: cat pendulum.txt (windows wont work!)
 The cat command shows the file content.
 The first column is the length of the pendulum and the second column is the time. We read the file line-by-line, collect the data into lists and plot them.
 
@@ -65,12 +56,6 @@
 for time in t:
     tsq.append(time*time) 
 
-# We also calculate the squares of the time-period and append to the
-# end of the tsq list.
-#     tsq.append(t[-1]*t[-1])
-# For any given list to access the last element python provides '-1'
-# index, so we use t[-1].
-
 Now lists l(en) and tsq have the required data. We can simply plot them, as we did earlier. 
 plot(l, tsq, 'o')
 
--- a/presentations/basic-plot.tex	Wed Apr 07 22:11:33 2010 +0530
+++ b/presentations/basic-plot.tex	Thu Apr 08 14:32:43 2010 +0530
@@ -87,7 +87,7 @@
 \end{frame}
 
 \begin{frame}
-  \frametitle{About the Workshop}
+  \frametitle{About the Session}
   \begin{block}{Intended Audience}
   \begin{itemize}
        \item Engg., Mathematics and Science teachers.
@@ -110,23 +110,23 @@
   \end{itemize}
 \end{frame}
 
-\begin{frame}[fragile]
-\frametitle{Starting up \ldots}
-\begin{block}{}
-\begin{verbatim}
-  $ ipython -pylab  
-\end{verbatim}
-\end{block}
-\begin{lstlisting}     
-  In []: print "Hello, World!"
-  Hello, World!
-\end{lstlisting}
-Exiting
-\begin{lstlisting}     
-  In []: ^D(Ctrl-D)
-  Do you really want to exit([y]/n)? y
-\end{lstlisting}
-\end{frame}
+%% \begin{frame}[fragile]
+%% \frametitle{Starting up \ldots}
+%% \begin{block}{}
+%% \begin{verbatim}
+%%   $ ipython -pylab  
+%% \end{verbatim}
+%% \end{block}
+%% \begin{lstlisting}     
+%%   In []: print "Hello, World!"
+%%   Hello, World!
+%% \end{lstlisting}
+%% Exiting
+%% \begin{lstlisting}     
+%%   In []: ^D(Ctrl-D)
+%%   Do you really want to exit([y]/n)? y
+%% \end{lstlisting}
+%% \end{frame}
 
 \begin{frame}[fragile]
   \frametitle{Summary}
@@ -164,3 +164,4 @@
 \end{frame}
 
 \end{document}
+