# HG changeset patch # User Santosh G. Vattam # Date 1258544263 -19800 # Node ID dc3631a29b180aacf0a4f63fa760db788653cdea # Parent 0b1f2c378d846a11017aa00d9964723f776420d5# Parent be62ebb11407b74d80b4d46d7b4adc6d70610215 Branches merged. diff -r 0b1f2c378d84 -r dc3631a29b18 day1/cheatsheet1.tex --- a/day1/cheatsheet1.tex Wed Nov 18 17:07:19 2009 +0530 +++ b/day1/cheatsheet1.tex Wed Nov 18 17:07:43 2009 +0530 @@ -33,10 +33,31 @@ \begin{lstlisting} In [2]: (Ctrl-D)^D Do you really want to exit ([y]/n)? y -\end{lstlisting} +\end{lstlisting} %$ \section{Plotting} +\subsection{Label} +Pylab accepts TeX equation expressions in any text expression. To get something like:\\ +$\sigma_i=15$ \\ +on title of figure use: +\begin{lstlisting} + title('$\sigma_i=15$') +\end{lstlisting} +Same way one can have TeX expression on xlabel, ylabel etc. + +\subsection{legends} +Apart from using \kwrd{loc='center'} for positioning the legend, one can also mention explicit co-ordinates for placement. +\begin{lstlisting} +In []: legend(['sin(2y)'], loc=(.8,.1)) +\end{lstlisting} +\typ{loc = 0, 1} (left top position of graph)\\ +\typ{loc = 0.5, 0.5} (center of graph). + +%\subsection{Multiple figures} + +\subsection{Saving figures} +One can save figure in any of these formats: png, pdf, ps, eps and svg. \begin{lstlisting} In [1]: x = linspace(0, 2*pi, 50) In [2]: plot(x, sin(x)) diff -r 0b1f2c378d84 -r dc3631a29b18 day1/session1.tex --- a/day1/session1.tex Wed Nov 18 17:07:19 2009 +0530 +++ b/day1/session1.tex Wed Nov 18 17:07:43 2009 +0530 @@ -353,19 +353,19 @@ \end{columns} \end{frame} -\begin{frame}[fragile] - \frametitle{For arbitrary location} -\vspace*{-0.1in} -\begin{lstlisting} -In []: legend(['sin(2y)'], loc=(.8,.1)) -\end{lstlisting} -\emphbar{Specify south-east corner position} -%\vspace*{-0.2in} -\begin{center} - \includegraphics[height=2in, interpolate=true]{data/loc} -\end{center} -%\inctime{10} -\end{frame} +%% \begin{frame}[fragile] +%% \frametitle{For arbitrary location} +%% \vspace*{-0.1in} +%% \begin{lstlisting} +%% In []: legend(['sin(2y)'], loc=(.8,.1)) +%% \end{lstlisting} +%% \emphbar{Specify south-east corner position} +%% %\vspace*{-0.2in} +%% \begin{center} +%% \includegraphics[height=2in, interpolate=true]{data/loc} +%% \end{center} +%% %\inctime{10} +%% \end{frame} \begin{frame}[fragile] \frametitle{Saving \& Closing}