diff options
author | Nishanth Amuluru | 2010-10-07 14:25:44 +0530 |
---|---|---|
committer | Nishanth Amuluru | 2010-10-07 14:25:44 +0530 |
commit | 0102b6e2bcdb72874f421c1e0dd270a19331bdb2 (patch) | |
tree | 144ae5da432d7eef498fc46f09ba4abbed73fbf9 | |
parent | bb2835e18bf5c60368e1cf32b86348e1363a72e3 (diff) | |
download | st-scripts-0102b6e2bcdb72874f421c1e0dd270a19331bdb2.tar.gz st-scripts-0102b6e2bcdb72874f421c1e0dd270a19331bdb2.tar.bz2 st-scripts-0102b6e2bcdb72874f421c1e0dd270a19331bdb2.zip |
Converted the embellishing_a_plot to new template form
-rw-r--r-- | embellishing_a_plot/quickref.tex | 11 | ||||
-rw-r--r-- | embellishing_a_plot/script.rst (renamed from embellishing_a_plot.rst) | 111 | ||||
-rw-r--r-- | embellishing_a_plot/slides.tex | 106 |
3 files changed, 135 insertions, 93 deletions
diff --git a/embellishing_a_plot/quickref.tex b/embellishing_a_plot/quickref.tex new file mode 100644 index 0000000..a0212b3 --- /dev/null +++ b/embellishing_a_plot/quickref.tex @@ -0,0 +1,11 @@ +Creating a tuple:\\ +{\ex \lstinline| t = (1, "hello", 2.5)|} + +Accessing elements of tuples:\\ +{\ex \lstinline| t[index] Ex: t[2]|} + +Accessing slices of tuples:\\ +{\ex \lstinline| t[start:stop:step]|} + +Swapping values:\\ +{\ex \lstinline| a, b = b, a|} diff --git a/embellishing_a_plot.rst b/embellishing_a_plot/script.rst index c030828..b37365b 100644 --- a/embellishing_a_plot.rst +++ b/embellishing_a_plot/script.rst @@ -1,9 +1,23 @@ -.. Author : Nishanth - Internal Reviewer 1 : Anoop - Internal Reviewer 2 : Madhu +.. Objectives +.. ---------- + +.. A - Students and teachers from Science and engineering backgrounds + B - + C - + D - + +.. Prerequisites +.. ------------- + +.. 1. Using the ``plot`` command interactively + +.. Author : Nishanth Amuluru + Internal Reviewer : External Reviewer : + Checklist OK? : <put date stamp here, if OK> [2010-10-05] -.. Prerequisites: using ``plot`` command +Script +------ Hello friends and welcome to the tutorial on Embellishing Plots. @@ -354,93 +368,4 @@ This tutorial was created as a part of FOSSEE project, NME ICT, MHRD India Hope you have enjoyed and found it useful. Thankyou -Questions -========= - - 1. Draw a plot of cosine graph between -2pi to 2pi with line thickness 4 - - Answer:: - - x = linspace(-2*pi, 2*pi) - plot(x, cos(x), linewidth=4) - - 2. Draw a plot of the polynomial x^2-5x+6 in the range 0 to 5 in blue dotted - line - - Answer:: - - x = linspace(-2*pi, 2*pi) - plot(x, x**2 - 5*x + 6, 'r.') - - 3. Which marker is used to get circles - - a. '.' - #. '^' - #. 'o' - #. '--' - - 4. What does the '^' marker produce - - Answer: Triangle up marker - - 5. How do you set the title as x^2-5x+6 in LaTex style formatting - - Answer: title("$x^2-5x+6$") - -6. What happens when the following code is executed:: - - xlabel("First label") - xlabel("Second label") - - Answer: The label of x-axis is set to "Second label" - - 7. Read thorugh the documentation and find out is there a way to modify the - alignment of text in the command ``ylabel`` - - a. Yes - #. No - - Answer: No - - 8. How to add the annotation "Maxima" at the point (1, 2) - - Answer: annotate("Maxima", xy=(1, 2)) - - 9. Is the command ``annotate("max", (1, 2))`` same as ``annotate("max", - xy=(1, 2)`` - - a. True - b. False - - Answer: True - - 10. When a new annotation is made at a point, what happens to the old one - - a. It is replaced - b. It is overwritten - c. The new annotation is combined with old one - - Answer: It is overwritten - - 11. What happens when xlim is used without arguments - - Answer: It gives the current limits of x-axis - - 12. What happens when ``ylim(0, 5)`` is used - - Answer: It sets the lower and upper limits of y-axis to 0 and 5 - - 13. Draw a cosine plot from 0 to 2*pi with green dots. annotate the origin as - "origin" and set x and y labels to "x" and cos(x) and x limits to 0 and - 2pi and y limits to -1.2 and 1.2 - - Answer:: - - x = linspace(0, 2*pi) - plot(x, cos(x), 'g.') - annotate("origin", (0, 0)) - xlabel("$x$") - ylabel("$cos(x)$") - xlim(0, 2*pi) - ylim(-1.2, 1.2) diff --git a/embellishing_a_plot/slides.tex b/embellishing_a_plot/slides.tex new file mode 100644 index 0000000..df1462c --- /dev/null +++ b/embellishing_a_plot/slides.tex @@ -0,0 +1,106 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%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} +\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{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} +\date{} + +% DOCUMENT STARTS +\begin{document} + +\begin{frame} + \maketitle +\end{frame} + +\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!} + \begin{block}{} + \begin{center} + This spoken tutorial has been produced by the + \textcolor{blue}{FOSSEE} team, which is funded by the + \end{center} + \begin{center} + \textcolor{blue}{National Mission on Education through \\ + Information \& Communication Technology \\ + MHRD, Govt. of India}. + \end{center} + \end{block} +\end{frame} + +\end{document} |