diff options
author | Nishanth Amuluru | 2010-10-12 10:32:34 +0530 |
---|---|---|
committer | Nishanth Amuluru | 2010-10-12 10:32:34 +0530 |
commit | 00bd44fbd761626874bdccad1145e1d4bac5d12b (patch) | |
tree | 0d379749659eef488fdd60e783df2cad93c53dde /embellishing_a_plot | |
parent | 41c474536a857f03dc01bb5c11782e33f6127c57 (diff) | |
download | st-scripts-00bd44fbd761626874bdccad1145e1d4bac5d12b.tar.gz st-scripts-00bd44fbd761626874bdccad1145e1d4bac5d12b.tar.bz2 st-scripts-00bd44fbd761626874bdccad1145e1d4bac5d12b.zip |
embellishing_a_plot is complete
Diffstat (limited to 'embellishing_a_plot')
-rw-r--r-- | embellishing_a_plot/quickref.tex | 39 | ||||
-rw-r--r-- | embellishing_a_plot/script.rst | 5 |
2 files changed, 31 insertions, 13 deletions
diff --git a/embellishing_a_plot/quickref.tex b/embellishing_a_plot/quickref.tex index a0212b3..78459f2 100644 --- a/embellishing_a_plot/quickref.tex +++ b/embellishing_a_plot/quickref.tex @@ -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")|} -Accessing elements of tuples:\\ -{\ex \lstinline| t[index] Ex: t[2]|} +Plot with a specific style. Ex: DASHED :\\ +{\ex \lstinline| plot(x, f(x), "--")|} + +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)")|} + +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)$")|} + +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)|} -Accessing slices of tuples:\\ -{\ex \lstinline| t[start:stop:step]|} -Swapping values:\\ -{\ex \lstinline| a, b = b, a|} diff --git a/embellishing_a_plot/script.rst b/embellishing_a_plot/script.rst index 8810157..e964389 100644 --- a/embellishing_a_plot/script.rst +++ b/embellishing_a_plot/script.rst @@ -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 |