# HG changeset patch # User Nishanth # Date 1286859754 -19800 # Node ID 9ab73cbdd5a8cb212756a8774736ef043c7739f1 # Parent 28a54b57049de997155a203c387953367cabc7d5 embellishing_a_plot is complete diff -r 28a54b57049d -r 9ab73cbdd5a8 embellishing_a_plot/quickref.tex --- a/embellishing_a_plot/quickref.tex Tue Oct 12 10:17:13 2010 +0530 +++ b/embellishing_a_plot/quickref.tex Tue Oct 12 10:32:34 2010 +0530 @@ -1,11 +1,34 @@ -Creating a tuple:\\ -{\ex \lstinline| t = (1, "hello", 2.5)|} +Plot with a specific color. Ex: RED :\\ +{\ex \lstinline| plot(x, f(x), "r")|} + +Plot with a specific style. Ex: DASHED :\\ +{\ex \lstinline| plot(x, f(x), "--")|} -Accessing elements of tuples:\\ -{\ex \lstinline| t[index] Ex: t[2]|} +Plot with specific color and style. Ex: RED DASHED :\\ +{\ex \lstinline| plot(x, f(x), "r--")|} + +Plot with a specific line thickness:\\ +{\ex \lstinline| plot(x, f(x), linewidth=3)|} + +Adding title:\\ +{\ex \lstinline| title("Plot of sin(x)")|} -Accessing slices of tuples:\\ -{\ex \lstinline| t[start:stop:step]|} +labelling the axes:\\ +{\ex \lstinline| xlabel("x")|} +{\ex \lstinline| ylabel("f(x)")|} + +Adding annotations:\\ +{\ex \lstinline| annotate("localmax", xy=(1, 2))|} + +Using LaTeX typesetting on any text:\\ +{\ex \lstinline| title("Plot of $sin(x)$")|} -Swapping values:\\ -{\ex \lstinline| a, b = b, a|} +Getting the axes limits:\\ +{\ex \lstinline| xlim()|} +{\ex \lstinline| ylim()|} + +Setting the axes limits:\\ +{\ex \lstinline| xlim(x_min, x_max)|} +{\ex \lstinline| ylim(y_min, y_max)|} + + diff -r 28a54b57049d -r 9ab73cbdd5a8 embellishing_a_plot/script.rst --- a/embellishing_a_plot/script.rst Tue Oct 12 10:17:13 2010 +0530 +++ b/embellishing_a_plot/script.rst Tue Oct 12 10:32:34 2010 +0530 @@ -1,11 +1,6 @@ .. Objectives .. ---------- -.. A - Students and teachers from Science and engineering backgrounds - B - - C - - D - - .. By the end of this tutorial you will be able to .. * Modify the attributes of the plot -- color, line style, linewidth