diff options
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/pgfmanualse9.html')
-rw-r--r-- | Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/pgfmanualse9.html | 4719 |
1 files changed, 4719 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/pgfmanualse9.html b/Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/pgfmanualse9.html new file mode 100644 index 00000000000..8d120dad446 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/pgfmanualse9.html @@ -0,0 +1,4719 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<html > +<head><title>9 Syntax for Path Specifications</title> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> +<meta name="generator" content="TeX4ht (http://www.cis.ohio-state.edu/~gurari/TeX4ht/mn.html)"> +<meta name="originator" content="TeX4ht (http://www.cis.ohio-state.edu/~gurari/TeX4ht/mn.html)"> +<!-- html --> +<meta name="src" content="pgfmanual.tex"> +<meta name="date" content="2005-10-23 18:34:00"> +<link rel="stylesheet" type="text/css" href="pgfmanual.css"> +</head><body +> + <div class="crosslinks"><p class="noindent">[<a +href="pgfmanualse10.html" >next</a>] [<a +href="pgfmanualse8.html" >prev</a>] [<a +href="pgfmanualse8.html#tailpgfmanualse8.html" >prev-tail</a>] [<a +href="#tailpgfmanualse9.html">tail</a>] [<a +href="pgfmanual.html#pgfmanualse9.html" >up</a>] </p></div> + <h3 class="sectionHead"><span class="titlemark">9 </span> <a + id="x10-970009"></a>Syntax for Path Specifications</h3> +<!--l. 10--><p class="noindent">A <span +class="cmti-10">path </span>is a series of straight and curved line segments. It is specified following a <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">\path</span></span></span> command and +the specification must follow a special syntax, which is described in the subsections of the present +section. +<!--l. 16--><p class="indent"> + <dl class="description"><dt class="description"> +<span +class="colorbox" id="colorbox24"><span +class="cmtt-10">\path</span><span +class="cmsy-10"><</span><span +class="cmti-10">specification</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">;</span></span></span></span> </dt><dd +class="description"> +<a + id="dx10-97001"></a> + <!--l. 17--><p class="noindent">This command is available only inside a <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">{tikzpicture}</span></span></span> environment. + <!--l. 19--><p class="noindent">The <span +class="cmsy-10"><</span><span +class="cmti-10">specification</span><span +class="cmsy-10">> </span>is a long stream of <span +class="cmti-10">path operations</span>. Most of these path operations tell Ti<span +class="cmti-10">k</span>Z how + the path is build. For example, when you write <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">--(0,0)</span></span></span>, you use a <span +class="cmti-10">line-to operation </span>and it means + “continue the path from wherever you are to the origin.” + <!--l. 25--><p class="noindent">At any point where Ti<span +class="cmti-10">k</span>Z expects a path operation, you can also give some graphic options, which + is a list of options in brackets, such as <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">[rounded</span><span +class="cmtt-10"> corners]</span></span></span>. These options can have different + effects: + <ol type="1" class="enumerate1" > + <li class="enumerate" value="1" +><a + id="x10-97003x1"></a>Some options take “immediate” effect and apply to all subsequent path operations on the path. + For example, the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">rounded</span><span +class="cmtt-10"> corners</span></span></span> option will round all following corners, but not the corners + “before” and if the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">sharp</span><span +class="cmtt-10"> corners</span></span></span> is given later on the path (in a new set of brackets), the + rounding effect will end. + <!--l. 37--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-95-" ><colgroup id="TBL-95-1g"><col +id="TBL-95-1"><col +id="TBL-95-2"></colgroup><tr + valign="baseline" id="TBL-95-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-95-1-1" +class="td11"> <object data="pgfmanual-99.svg" width="85.75822pt" height="28.85274pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-95-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"><br><span +class="cmtt-8">\tikz</span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (1,1)</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> [rounded</span><span +class="cmtt-8"> corners]</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (2,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (3,1)</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> [sharp</span><span +class="cmtt-8"> corners]</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (3,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (2,1);</span></div> </td></tr></table> </td> +</tr></table></div> + <!--l. 42--><p class="noindent">Another example are the transformation options, which also apply only to subsequent coordinates. + </li> + <li class="enumerate" value="2" +><a + id="x10-97005x2"></a>The options that have immediate effect can be “scoped” by putting part of a path in curly braces. For + example, the above example could also be written as follows: + <!--l. 49--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-96-" ><colgroup id="TBL-96-1g"><col +id="TBL-96-1"><col +id="TBL-96-2"></colgroup><tr + valign="baseline" id="TBL-96-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-96-1-1" +class="td11"> <object data="pgfmanual-100.svg" width="85.75822pt" height="28.85274pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-96-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"><br><span +class="cmtt-8">\tikz</span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (1,1)</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> {[rounded</span><span +class="cmtt-8"> corners]</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (2,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (3,1)}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (3,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (2,1);</span></div> </td></tr></table> </td> +</tr></table></div> + </li> + <li class="enumerate" value="3" +><a + id="x10-97007x3"></a>Some options only apply to the path as a whole. For example, the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">color=</span></span></span> option for determining the + color used for, say, drawing the path always applies to all parts of the path. If several different + colors are given for different parts of the path, only the last one (on the outermost scope) + “wins”: + <!--l. 61--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-97-" ><colgroup id="TBL-97-1g"><col +id="TBL-97-1"><col +id="TBL-97-2"></colgroup><tr + valign="baseline" id="TBL-97-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-97-1-1" +class="td11"> <object data="pgfmanual-101.svg" width="85.75822pt" height="28.85274pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-97-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"><br><span +class="cmtt-8">\tikz</span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (1,1)</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> [color=red]</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (2,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (3,1)</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> [color=blue]</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (3,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (2,1);</span></div> </td></tr></table> </td> +</tr></table></div> + <!--l. 67--><p class="noindent">Most options are of this type. In the above example, we would have had to “split up” the path into + several <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">\path</span></span></span> commands: + + + <!--l. 69--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-98-" ><colgroup id="TBL-98-1g"><col +id="TBL-98-1"><col +id="TBL-98-2"></colgroup><tr + valign="baseline" id="TBL-98-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-98-1-1" +class="td11"> <object data="pgfmanual-102.svg" width="85.75822pt" height="28.85274pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-98-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"><br><span +class="cmtt-8">\tikz{\draw</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (1,1);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> [color=red]</span><span +class="cmtt-8"> (2,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (3,1);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> [color=blue]</span><span +class="cmtt-8"> (3,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (2,1);}</span></div> </td></tr></table> </td> +</tr></table></div> + </li></ol> + <!--l. 76--><p class="noindent">By default, the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">\path</span></span></span> command does “nothing” with the path, it just “throws it away.” Thus, if you write + <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">\path(0,0)--(1,1);</span></span></span>, nothing is drawn in your picture. The only effect is that the area occupied by the + picture is (possibly) enlarged so that the path fits inside the area. To actually “do” something with the path, + an option like <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">draw</span></span></span> or <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">fill</span></span></span> must be given somewhere on the path. Commands like <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">\draw</span></span></span> do this + implicitly. + <!--l. 85--><p class="noindent">Finally, it is also possible to give <span +class="cmti-10">node specifications </span>on a path. Such specifications can come at + different locations, but they are always allowed when a normal path operation could follow. A + node specification starts with <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">node</span></span></span>. Basically, the effect is to typeset the node’s text as normal + <span class="TEX">T<span +class="E">E</span>X</span> text and to place it at the “current location” on the path. The details are explained in + Section <a +href="pgfmanualse11.html#x12-13600011">11<!--tex4ht:ref: section-nodes --></a>. + <!--l. 93--><p class="noindent">Note, however, that the nodes are <span +class="cmti-10">not </span>part of the path in any way. Rather, after everything has been done + with the path what is specified by the path options (like filling and drawing the path due to a <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">fill</span></span></span> + and a <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">draw</span></span></span> option somewhere in the <span +class="cmsy-10"><</span><span +class="cmti-10">specification</span><span +class="cmsy-10">></span>), the nodes are added in a post-processing + step. + <!--l. 100--><p class="noindent">The following style influences scopes: + <ul class="itemize1"> + <li class="itemize"><span +class="cmtt-10">style=</span><span +class="cmtt-10">every path</span><a + id="dx10-97008"></a><a + id="dx10-97009"></a> This style is installed at the beginning of every path. This can be useful for + (temporarily) adding, say, the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">draw</span></span></span> option to everything in a scope. + <!--l. 106--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-99-" ><colgroup id="TBL-99-1g"><col +id="TBL-99-1"><col +id="TBL-99-2"></colgroup><tr + valign="baseline" id="TBL-99-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-99-1-1" +class="td11"> <object data="pgfmanual-103.svg" width="85.75822pt" height="28.85274pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-99-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}[fill=examplefill]</span><span +class="cmtt-8"> </span><span +class="cmsltt-10x-x-80">%</span><span +class="cmsltt-10x-x-80"> only</span><span +class="cmsltt-10x-x-80"> sets</span><span +class="cmsltt-10x-x-80"> the</span><span +class="cmsltt-10x-x-80"> color</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \tikzstyle{every</span><span +class="cmtt-8"> path}=[draw]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmsltt-10x-x-80">%</span><span +class="cmsltt-10x-x-80"> all</span><span +class="cmsltt-10x-x-80"> paths</span><span +class="cmsltt-10x-x-80"> are</span><span +class="cmsltt-10x-x-80"> drawn</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \fill</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> rectangle</span><span +class="cmtt-8"> +(1,1);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \shade</span><span +class="cmtt-8"> (2,0)</span><span +class="cmtt-8"> rectangle</span><span +class="cmtt-8"> +(1,1);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + </li></ul> + </dd></dl> +<!--l. 119--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">9.1 </span> <a + id="x10-980009.1"></a>The Move-To Operation</h4> +<!--l. 121--><p class="noindent">The perhaps simplest operation is the move-to operation, which is specified by just giving a coordinate where a path +operation is expected. +<!--l. 125--><p class="indent"> + <dl class="description"><dt class="description"> +<span +class="colorbox" id="colorbox25"><span id="textcolor26"><span +class="cmtt-10">\path</span> ...</span> <span +class="cmsy-10"><</span><span +class="cmti-10">coordinate</span><span +class="cmsy-10">></span> <span id="textcolor27">...<span +class="cmtt-10">;</span></span></span> </dt><dd +class="description"> +<a + id="dx10-98001"></a> +<a + id="dx10-98002"></a> + <!--l. 128--><p class="noindent">The move-to operation normally starts a path at a certain point. This does not cause a line segment + to be created, but it specifies the starting point of the next segment. If a path is already under + construction, that is, if several segments have already been created, a move-to operation will start a + new part of the path that is not connected to any of the previous segments. + <!--l. 135--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-100-" ><colgroup id="TBL-100-1g"><col +id="TBL-100-1"><col +id="TBL-100-2"></colgroup><tr + valign="baseline" id="TBL-100-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-100-1-1" +class="td11"> <object data="pgfmanual-104.svg" width="57.30548pt" height="28.85274pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-100-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> --(2,0)</span><span +class="cmtt-8"> (0,1)</span><span +class="cmtt-8"> --(2,1);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + + + <!--l. 141--><p class="noindent">In the specification <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">(0,0)</span><span +class="cmtt-10"> --(2,0)</span><span +class="cmtt-10"> (0,1)</span><span +class="cmtt-10"> --(2,1)</span></span></span> two move-to operations are specified: <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">(0,0)</span></span></span> and <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">(0,1)</span></span></span>. + The other two operations, namely <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">--(2,0)</span></span></span> and <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">--(2,1)</span></span></span> are line-to operations, described next. + </dd></dl> +<!--l. 148--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">9.2 </span> <a + id="x10-990009.2"></a>The Line-To Operation</h4> +<!--l. 151--><p class="noindent"> + <h5 class="subsubsectionHead"><span class="titlemark">9.2.1 </span> <a + id="x10-1000009.2.1"></a>Straight Lines</h5> +<!--l. 153--><p class="noindent"> + <dl class="description"><dt class="description"> +<span +class="colorbox" id="colorbox28"><span id="textcolor29"><span +class="cmtt-10">\path</span> ...</span> <span +class="cmtt-10">--</span><span +class="cmsy-10"><</span><span +class="cmti-10">coordinate</span><span +class="cmsy-10">></span> <span id="textcolor30">...<span +class="cmtt-10">;</span></span></span> </dt><dd +class="description"> +<a + id="dx10-100001"></a> +<a + id="dx10-100002"></a> + <!--l. 154--><p class="noindent">The line-to operation extends the current path from the current point in a straight line to the given + coordinate. The “current point” is the endpoint of the previous drawing operation or the point specified + by a prior move-to operation. + <!--l. 159--><p class="noindent">You use two minus signs followed by a coordinate in round brackets. You can add spaces before and + after the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">--</span></span></span>. + <!--l. 162--><p class="noindent">When a line-to operation is used and some path segment has just been constructed, for example by + another line-to operation, the two line segments become joined. This means that if they are drawn, the + point where they meet is “joined” smoothly. To appreciate the difference, consider the following two + examples: In the left example, the path consists of two path segments that are not joined, but that + happen to share a point, while in the right example a smooth join is shown. + <!--l. 170--><p class="noindent"><div class="obeylines-v"></div><object data="pgfmanual-105.svg" width="152.26372pt" height="47.67911pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-101-" ><colgroup id="TBL-101-1g"><col +id="TBL-101-1"></colgroup><tr + valign="baseline" id="TBL-101-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-101-1-1" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}[line</span><span +class="cmtt-8"> width=10pt]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> --(1,1)</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (1,1)</span><span +class="cmtt-8"> --(2,0);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (3,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (4,1)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (5,0);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \useasboundingbox</span><span +class="cmtt-8"> (0,1.5);</span><span +class="cmtt-8"> </span><span +class="cmsltt-10x-x-80">%</span><span +class="cmsltt-10x-x-80"> make</span><span +class="cmsltt-10x-x-80"> bounding</span><span +class="cmsltt-10x-x-80"> box</span><span +class="cmsltt-10x-x-80"> higher</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + </dd></dl> +<!--l. 181--><p class="noindent"> + <h5 class="subsubsectionHead"><span class="titlemark">9.2.2 </span> <a + id="x10-1010009.2.2"></a>Horizontal and Vertical Lines</h5> +<!--l. 183--><p class="noindent">Sometimes you want to connect two points via straight lines that are only horizontal and vertical. For this, you can +use two path construction operations. +<!--l. 188--><p class="indent"> + <dl class="description"><dt class="description"> +<span +class="colorbox" id="colorbox31"><span id="textcolor32"><span +class="cmtt-10">\path</span> ...</span> <span +class="cmtt-10">-|</span><span +class="cmsy-10"><</span><span +class="cmti-10">coordinate</span><span +class="cmsy-10">></span> <span id="textcolor33">...<span +class="cmtt-10">;</span></span></span> </dt><dd +class="description"> +<a + id="dx10-101001"></a> +<a + id="dx10-101002"></a> + <!--l. 191--><p class="noindent">This operation means “first horizontal, then vertical.” + <!--l. 193--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-102-" ><colgroup id="TBL-102-1g"><col +id="TBL-102-1"><col +id="TBL-102-2"></colgroup><tr + valign="baseline" id="TBL-102-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-102-1-1" +class="td11"> <object data="pgfmanual-106.svg" width="64.38846pt" height="49.82874pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-102-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> node(a)</span><span +class="cmtt-8"> [draw]</span><span +class="cmtt-8"> {A}</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (1,1)</span><span +class="cmtt-8"> node(b)</span><span +class="cmtt-8"> [draw]</span><span +class="cmtt-8"> {B};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (a.north)</span><span +class="cmtt-8"> |-</span><span +class="cmtt-8"> (b.west);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[color=red]</span><span +class="cmtt-8"> (a.east)</span><span +class="cmtt-8"> -|</span><span +class="cmtt-8"> (2,1.5)</span><span +class="cmtt-8"> -|</span><span +class="cmtt-8"> (b.north);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + + + </dd></dl> +<!--l. 201--><p class="noindent"> + <dl class="description"><dt class="description"> +<span +class="colorbox" id="colorbox34"><span id="textcolor35"><span +class="cmtt-10">\path</span> ...</span> <span +class="cmtt-10">|-</span><span +class="cmsy-10"><</span><span +class="cmti-10">coordinate</span><span +class="cmsy-10">></span> <span id="textcolor36">...<span +class="cmtt-10">;</span></span></span> </dt><dd +class="description"> +<a + id="dx10-101003"></a> +<a + id="dx10-101004"></a> + <!--l. 204--><p class="noindent">This operations means “first vertical, then horizontal.” </dd></dl> +<!--l. 209--><p class="noindent"> + <h5 class="subsubsectionHead"><span class="titlemark">9.2.3 </span> <a + id="x10-1020009.2.3"></a>Snaked Lines</h5> +<!--l. 212--><p class="noindent">The line-to operation can not only be used to append straight lines to the path, but also “snaked” lines (called thus +because they look a little bit like snakes seen from above). +<!--l. 216--><p class="indent"> Ti<span +class="cmti-10">k</span>Z and <span +class="cmcsc-10"><small +class="small-caps">P</small><small +class="small-caps">G</small><small +class="small-caps">F</small></span> use a concept that I termed <span +class="cmti-10">snakes </span>for appending such “squiggly” lines. A snake specifies a way +of extending a path between two points in a “fancy manner.” +<!--l. 220--><p class="indent"> Normally, a snake will just connect the start point to the end point without starting new subpaths. Thus, a path +containing a snaked line can, nevetheless, still be used for filling. However, this is not always the case. Some snakes +consist of numerous unconnected segments. “Lines” consisting of such snakes cannot be used as the borders of +enclosed areas. +<!--l. 227--><p class="indent"> Here are some examples of snakes in action: +<!--l. 229--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-103-" ><colgroup id="TBL-103-1g"><col +id="TBL-103-1"><col +id="TBL-103-2"></colgroup><tr + valign="baseline" id="TBL-103-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-103-1-1" +class="td11"> <object data="pgfmanual-107.svg" width="86.15822pt" height="95.90797pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-103-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}[thick]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (0,3)</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (3,3);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=zigzag]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (0,2.5)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (3,2.5);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=brace]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (0,2)</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (3,2);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=triangles]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (0,1.5)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (3,1.5);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=coil,segment</span><span +class="cmtt-8"> length=4pt]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (0,1)</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (3,1);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=coil,segment</span><span +class="cmtt-8"> aspect=0]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (0,.5)</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (3,.5);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=expanding</span><span +class="cmtt-8"> waves,segment</span><span +class="cmtt-8"> angle=7]</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (3,0);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> +<!--l. 241--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"> +<table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-104-" ><colgroup id="TBL-104-1g"><col +id="TBL-104-1"><col +id="TBL-104-2"></colgroup><tr + valign="baseline" id="TBL-104-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-104-1-1" +class="td11"> <object data="pgfmanual-108.svg" width="90.73915pt" height="62.295pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-104-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \filldraw[fill=red!20,snake=bumps]</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> rectangle</span><span +class="cmtt-8"> (3,2);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> +<!--l. 247--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-105-" ><colgroup id="TBL-105-1g"><col +id="TBL-105-1"><col +id="TBL-105-2"></colgroup><tr + valign="baseline" id="TBL-105-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-105-1-1" +class="td11"> <object data="pgfmanual-109.svg" width="89.4185pt" height="62.3028pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-105-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \filldraw[fill=blue!20]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (0,3)</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> [snake=saw]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (3,3)</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> [snake=coil,segment</span><span +class="cmtt-8"> aspect=0]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (2,1)</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> [snake=bumps]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> -|</span><span +class="cmtt-8"> (0,3);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + + +<!--l. 256--><p class="indent"> No special path operation is needed to use a snake. Instead, you use the following option to “switch on” +snaking: + <ul class="itemize1"> + <li class="itemize"><span +class="cmtt-10">snake</span><a + id="dx10-102001"></a><a + id="dx10-102002"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">snake name</span><span +class="cmsy-10">></span> This option causes the snake <span +class="cmsy-10"><</span><span +class="cmti-10">snake name</span><span +class="cmsy-10">> </span>to be used for subsequent line-to + operations. So, whenever you use the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">--</span></span></span> syntax to specify that a straight line should be added to the + path, a snake to this path will be added instead. Snakes will also be used when you use the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">-|</span></span></span> and + <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">|-</span></span></span> syntax and also when you use the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">rectangle</span></span></span> operation. Snakes will <span +class="cmti-10">not </span>be used when you use the + curve-to operation nor when any other “curved” line is added to the path. + <!--l. 270--><p class="noindent">This option has to be given anew for each path. However, you can also leave out the <span +class="cmsy-10"><</span><span +class="cmti-10">snake name</span><span +class="cmsy-10">></span>. In + this case, the enclosing scope’s <span +class="cmsy-10"><</span><span +class="cmti-10">snake name</span><span +class="cmsy-10">> </span>is used. Thus, you can specify a “standard” snake name + for scope and then just say <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">\draw[snake]</span></span></span> every time this snake should actually be used. + <!--l. 276--><p class="noindent">The <span +class="cmsy-10"><</span><span +class="cmti-10">snake name</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">none</span></span></span> is special. It can be used to switch off snaking after it has been switched on + on a path. + <!--l. 279--><p class="noindent">A bit strangely, no valid <span +class="cmsy-10"><</span><span +class="cmti-10">snake names</span><span +class="cmsy-10">> </span>are defined by Ti<span +class="cmti-10">k</span>Z by default. Instead, you have to include + the library package <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">pgflibrarysnakes</span></span></span>. This package defines numerous snakes, see Section <a +href="pgfmanualse14.html#x15-16700014.2">14.2<!--tex4ht:ref: section-library-snakes --></a> for + the complete list.</li></ul> +<!--l. 285--><p class="indent"> Most snakes can be configured. For example, for a snake that looks like a sine curve, you might wish to change +the amplitude or the frequency. There are numerous options that influence these parameters. Not all options apply +to all snakes, see Section <a +href="pgfmanualse14.html#x15-16700014.2">14.2<!--tex4ht:ref: section-library-snakes --></a> once more for details. + <ul class="itemize1"> + <li class="itemize"><span +class="cmtt-10">gap before snakes</span><a + id="dx10-102003"></a><a + id="dx10-102004"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>This option allows you to add a certain “gap” to the snake at its beginning. + The snake will not start at the current point; instead the start point of the snake is move be <span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>in + the direction of the target. + <!--l. 297--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-106-" ><colgroup id="TBL-106-1g"><col +id="TBL-106-1"><col +id="TBL-106-2"></colgroup><tr + valign="baseline" id="TBL-106-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-106-1-1" +class="td11"> <object data="pgfmanual-110.svg" width="85.65822pt" height="57.34164pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-106-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[help</span><span +class="cmtt-8"> lines]</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> grid</span><span +class="cmtt-8"> (3,2);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=zigzag]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (0,1)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> ++(3,1);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=zigzag,gap</span><span +class="cmtt-8"> before</span><span +class="cmtt-8"> snake=1cm]</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> ++(3,1);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + </li> + <li class="itemize"><span +class="cmtt-10">gap after snake</span><a + id="dx10-102005"></a><a + id="dx10-102006"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>This option has the same effect as <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">gap</span><span +class="cmtt-10"> before</span><span +class="cmtt-10"> snake</span></span></span>, only it affects the end + of the snake, which will “end early.” + </li> + <li class="itemize"><span +class="cmtt-10">gap around snake</span><a + id="dx10-102007"></a><a + id="dx10-102008"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>This option sets the gap before and after the gap to <span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">></span>. + <!--l. 310--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-107-" ><colgroup id="TBL-107-1g"><col +id="TBL-107-1"><col +id="TBL-107-2"></colgroup><tr + valign="baseline" id="TBL-107-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-107-1-1" +class="td11"> <object data="pgfmanual-111.svg" width="85.65822pt" height="57.99251pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-107-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[help</span><span +class="cmtt-8"> lines]</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> grid</span><span +class="cmtt-8"> (3,2);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=brace]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (0,1)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> ++(3,1);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=brace,gap</span><span +class="cmtt-8"> around</span><span +class="cmtt-8"> snake=5mm]</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> ++(3,1);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + </li> + <li class="itemize"><span +class="cmtt-10">line before snake</span><a + id="dx10-102009"></a><a + id="dx10-102010"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>This option works like <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">gap</span><span +class="cmtt-10"> before</span><span +class="cmtt-10"> snake</span></span></span>, only it will connect the current + point with a straight line to the start of the snake. + + + <!--l. 320--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-108-" ><colgroup id="TBL-108-1g"><col +id="TBL-108-1"><col +id="TBL-108-2"></colgroup><tr + valign="baseline" id="TBL-108-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-108-1-1" +class="td11"> <object data="pgfmanual-112.svg" width="85.65822pt" height="57.34164pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-108-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[help</span><span +class="cmtt-8"> lines]</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> grid</span><span +class="cmtt-8"> (3,2);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=zigzag]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (0,1)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> ++(3,1);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=zigzag,line</span><span +class="cmtt-8"> before</span><span +class="cmtt-8"> snake=1cm]</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> ++(3,1);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + </li> + <li class="itemize"><span +class="cmtt-10">line after snake</span><a + id="dx10-102011"></a><a + id="dx10-102012"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>Works line <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">gap</span><span +class="cmtt-10"> after</span><span +class="cmtt-10"> snake</span></span></span>, only it adds a straight line. + </li> + <li class="itemize"><span +class="cmtt-10">line around snake</span><a + id="dx10-102013"></a><a + id="dx10-102014"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>Works line <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">gap</span><span +class="cmtt-10"> around</span><span +class="cmtt-10"> snake</span></span></span>, only it adds straight lines. + </li> + <li class="itemize"><span +class="cmtt-10">raise snake</span><a + id="dx10-102015"></a><a + id="dx10-102016"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>This option can be used with all snakes. It will offset the snake by “raising” it by + <span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">></span>. A negative <span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>will lower the snake. Raising and lowering is always relative to the line + along which the snake is drawn. Here is an example: + <!--l. 336--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-109-" ><colgroup id="TBL-109-1g"><col +id="TBL-109-1"><col +id="TBL-109-2"></colgroup><tr + valign="baseline" id="TBL-109-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-109-1-1" +class="td11"> <object data="pgfmanual-113.svg" width="70.86311pt" height="41.95201pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-109-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \node</span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> {A};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \node</span><span +class="cmtt-8"> (b)</span><span +class="cmtt-8"> at</span><span +class="cmtt-8"> (2,1)</span><span +class="cmtt-8"> {B};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (b);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=brace]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (b);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=brace,raise</span><span +class="cmtt-8"> snake=5pt,red]</span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (b);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + </li> + <li class="itemize"><span +class="cmtt-10">mirror snake</span><a + id="dx10-102017"></a><a + id="dx10-102018"></a> This option causes the snake to be “reflected along the path.” This is best understood by + looking at an example: + <!--l. 348--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-110-" ><colgroup id="TBL-110-1g"><col +id="TBL-110-1"><col +id="TBL-110-2"></colgroup><tr + valign="baseline" id="TBL-110-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-110-1-1" +class="td11"> <object data="pgfmanual-114.svg" width="70.86311pt" height="41.95201pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-110-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \node</span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> {A};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \node</span><span +class="cmtt-8"> (b)</span><span +class="cmtt-8"> at</span><span +class="cmtt-8"> (2,1)</span><span +class="cmtt-8"> {B};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (b);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=brace]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (b);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=brace,mirror</span><span +class="cmtt-8"> snake,red,thick]</span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (b);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + <!--l. 357--><p class="noindent">This option can be used with every snake and can be combined with the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">raise</span><span +class="cmtt-10"> snake</span></span></span> option. + </li> + <li class="itemize"><span +class="cmtt-10">segment amplitude</span><a + id="dx10-102019"></a><a + id="dx10-102020"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>This option sets the “amplitude” of the snake. For a snake that + is a sine wave this would be the amplitude of this line. For other snakes this value typically + describes how far the snakes “rises above” or “falls below” the path. For some snakes, this value is + ignored. + + + <!--l. 365--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-111-" ><colgroup id="TBL-111-1g"><col +id="TBL-111-1"><col +id="TBL-111-2"></colgroup><tr + valign="baseline" id="TBL-111-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-111-1-1" +class="td11"> <object data="pgfmanual-115.svg" width="70.93256pt" height="70.40475pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-111-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \node</span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> {A}</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> node</span><span +class="cmtt-8"> (b)</span><span +class="cmtt-8"> at</span><span +class="cmtt-8"> (2,1)</span><span +class="cmtt-8"> {B}</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> node</span><span +class="cmtt-8"> (c)</span><span +class="cmtt-8"> at</span><span +class="cmtt-8"> (2,-1)</span><span +class="cmtt-8"> {C};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=zigzag]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (b);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=zigzag,segment</span><span +class="cmtt-8"> amplitude=5pt,red,thick]</span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (c);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + </li> + <li class="itemize"><span +class="cmtt-10">segment length</span><a + id="dx10-102021"></a><a + id="dx10-102022"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>This option sets the length of each “segment” of a snake. For a sine wave + this would be the wave length, for other snakes it is the length of each “repetitive part” of the + snake. + <!--l. 376--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-112-" ><colgroup id="TBL-112-1g"><col +id="TBL-112-1"><col +id="TBL-112-2"></colgroup><tr + valign="baseline" id="TBL-112-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-112-1-1" +class="td11"> <object data="pgfmanual-116.svg" width="70.93256pt" height="70.40475pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-112-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \node</span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> {A}</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> node</span><span +class="cmtt-8"> (b)</span><span +class="cmtt-8"> at</span><span +class="cmtt-8"> (2,1)</span><span +class="cmtt-8"> {B}</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> node</span><span +class="cmtt-8"> (c)</span><span +class="cmtt-8"> at</span><span +class="cmtt-8"> (2,-1)</span><span +class="cmtt-8"> {C};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=zigzag]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (b);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=zigzag,segment</span><span +class="cmtt-8"> length=20pt,red,thick]</span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (c);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + <!--l. 383--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"> +<table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-113-" ><colgroup id="TBL-113-1g"><col +id="TBL-113-1"><col +id="TBL-113-2"></colgroup><tr + valign="baseline" id="TBL-113-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-113-1-1" +class="td11"> <object data="pgfmanual-117.svg" width="70.93256pt" height="70.40475pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-113-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \node</span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> {A}</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> node</span><span +class="cmtt-8"> (b)</span><span +class="cmtt-8"> at</span><span +class="cmtt-8"> (2,1)</span><span +class="cmtt-8"> {B}</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> node</span><span +class="cmtt-8"> (c)</span><span +class="cmtt-8"> at</span><span +class="cmtt-8"> (2,-1)</span><span +class="cmtt-8"> {C};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=bumps]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (b);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=bumps,segment</span><span +class="cmtt-8"> length=20pt,red,thick]</span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (c);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + </li> + <li class="itemize"><span +class="cmtt-10">segment object length</span><a + id="dx10-102023"></a><a + id="dx10-102024"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>This option sets the length of the objects inside each segment of a + snake. This option is only used for snakes in which each segment contains an object like a triangle or a + star. + <!--l. 394--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-114-" ><colgroup id="TBL-114-1g"><col +id="TBL-114-1"><col +id="TBL-114-2"></colgroup><tr + valign="baseline" id="TBL-114-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-114-1-1" +class="td11"> <object data="pgfmanual-118.svg" width="70.93256pt" height="70.40475pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-114-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \node</span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> {A}</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> node</span><span +class="cmtt-8"> (b)</span><span +class="cmtt-8"> at</span><span +class="cmtt-8"> (2,1)</span><span +class="cmtt-8"> {B}</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> node</span><span +class="cmtt-8"> (c)</span><span +class="cmtt-8"> at</span><span +class="cmtt-8"> (2,-1)</span><span +class="cmtt-8"> {C};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=triangles]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (b);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=triangles,segment</span><span +class="cmtt-8"> object</span><span +class="cmtt-8"> length=8pt,red,thick]</span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (c);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + </li> + <li class="itemize"><span +class="cmtt-10">segment angle</span><a + id="dx10-102025"></a><a + id="dx10-102026"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">degrees</span><span +class="cmsy-10">> </span>This option sets an angle that is interpreted in a snake-specific way. For example, + the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">waves</span></span></span> and <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">expanding</span><span +class="cmtt-10"> waves</span></span></span> snakes interpret this as (half the) opening angle of the wave. The <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">border</span></span></span> + snake uses this value for the angle of the little ticks. + + + <!--l. 406--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-115-" ><colgroup id="TBL-115-1g"><col +id="TBL-115-1"><col +id="TBL-115-2"></colgroup><tr + valign="baseline" id="TBL-115-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-115-1-1" +class="td11"> <object data="pgfmanual-119.svg" width="70.86311pt" height="14.0207pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-115-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}[segment</span><span +class="cmtt-8"> amplitude=10pt]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \node</span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> {A}</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> node</span><span +class="cmtt-8"> (b)</span><span +class="cmtt-8"> at</span><span +class="cmtt-8"> (2,0)</span><span +class="cmtt-8"> {B};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=border]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (b);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=border,segment</span><span +class="cmtt-8"> angle=20,red,thick]</span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (b);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + <!--l. 413--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-116-" ><colgroup id="TBL-116-1g"><col +id="TBL-116-1"><col +id="TBL-116-2"></colgroup><tr + valign="baseline" id="TBL-116-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-116-1-1" +class="td11"> <object data="pgfmanual-120.svg" width="70.86311pt" height="71.01807pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-116-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}[segment</span><span +class="cmtt-8"> amplitude=10pt]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \node</span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> {A}</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> node</span><span +class="cmtt-8"> (b)</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> at</span><span +class="cmtt-8"> (2,0)</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> {B};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \node</span><span +class="cmtt-8"> (a')</span><span +class="cmtt-8"> at</span><span +class="cmtt-8"> (0,-1)</span><span +class="cmtt-8"> {A}</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> node</span><span +class="cmtt-8"> (b')</span><span +class="cmtt-8"> at</span><span +class="cmtt-8"> (2,-1)</span><span +class="cmtt-8"> {B};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=expanding</span><span +class="cmtt-8"> waves]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (b);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=expanding</span><span +class="cmtt-8"> waves,segment</span><span +class="cmtt-8"> angle=20,red,thick]</span><span +class="cmtt-8"> (a')</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (b');</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + </li> + <li class="itemize"><span +class="cmtt-10">segment aspect</span><a + id="dx10-102027"></a><a + id="dx10-102028"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">ratio</span><span +class="cmsy-10">> </span>This option sets an aspect ratio that is interpreted in a snake-specific way. For + example, for the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">coils</span></span></span> snake this describes the “direction” from which the coil is viewed. + <!--l. 425--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-117-" ><colgroup id="TBL-117-1g"><col +id="TBL-117-1"><col +id="TBL-117-2"></colgroup><tr + valign="baseline" id="TBL-117-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-117-1-1" +class="td11"> <object data="pgfmanual-121.svg" width="70.93256pt" height="70.40475pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-117-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}[segment</span><span +class="cmtt-8"> amplitude=5pt,segment</span><span +class="cmtt-8"> length=5pt]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \node</span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> {A}</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> node</span><span +class="cmtt-8"> (b)</span><span +class="cmtt-8"> at</span><span +class="cmtt-8"> (2,1)</span><span +class="cmtt-8"> {B}</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> node</span><span +class="cmtt-8"> (c)</span><span +class="cmtt-8"> at</span><span +class="cmtt-8"> (2,-1)</span><span +class="cmtt-8"> {C};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=coil]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (b);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[snake=coil,segment</span><span +class="cmtt-8"> aspect=0,red,thick]</span><span +class="cmtt-8"> (a)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (c);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + </li></ul> +<!--l. 434--><p class="indent"> It is possible to define new snakes, but this cannot be done inside Ti<span +class="cmti-10">k</span>Z. You need to use the command +<span class="obeylines-h"><span class="verb"><span +class="cmtt-10">\pgfdeclaresnake</span></span></span> from the basic level directly, see Section <a +href="pgfmanualse22.html#x23-22900022">22<!--tex4ht:ref: section-base-snakes --></a>. +<!--l. 438--><p class="indent"> The following styles define combinations of segment settings that may be useful: + <ul class="itemize1"> + <li class="itemize"><span +class="cmtt-10">style=</span><span +class="cmtt-10">snake triangles 45</span><a + id="dx10-102029"></a><a + id="dx10-102030"></a> Installs a snake the consists of little triangles with an opening angle of + 45<sup ><span +class="cmsy-7"><span class="htf-cmbx">o</span></span></sup>. + </li> + <li class="itemize"><span +class="cmtt-10">style=</span><span +class="cmtt-10">snake triangles 60</span><a + id="dx10-102031"></a><a + id="dx10-102032"></a> Installs a snake the consists of little triangles with an opening angle of + 60<sup ><span +class="cmsy-7"><span class="htf-cmbx">o</span></span></sup>. + </li> + <li class="itemize"><span +class="cmtt-10">style=</span><span +class="cmtt-10">snake triangles 90</span><a + id="dx10-102033"></a><a + id="dx10-102034"></a> Installs a snake the consists of little triangles with an opening angle of + 90<sup ><span +class="cmsy-7"><span class="htf-cmbx">o</span></span></sup>.</li></ul> +<!--l. 454--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">9.3 </span> <a + id="x10-1030009.3"></a>The Curve-To Operation</h4> +<!--l. 456--><p class="noindent">The curve-to operation allows you to extend a path using a Bézier curve. +<!--l. 459--><p class="indent"> + + + <dl class="description"><dt class="description"> +<span +class="colorbox" id="colorbox37"><span id="textcolor38"><span +class="cmtt-10">\path</span> ...</span> <span +class="cmtt-10">..</span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">controls</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">c</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">and</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">d</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">..</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">y</span><span +class="cmsy-10">></span> <span id="textcolor39">...<span +class="cmtt-10">;</span></span></span> </dt><dd +class="description"> +<a + id="dx10-103001"></a> +<a + id="dx10-103002"></a> + <!--l. 460--><p class="noindent">This operation extends the current path from the current point, let us call it <span +class="cmmi-10">x</span>, via a curve to a the + current point <span +class="cmmi-10">y</span>. The curve is a cubic Bézier curve. For such a curve, apart from <span +class="cmmi-10">y</span>, you also specify + two control points <span +class="cmmi-10">c </span>and <span +class="cmmi-10">d</span>. The idea is that the curve starts at <span +class="cmmi-10">x</span>, “heading” in the direction of <span +class="cmmi-10">c</span>. + Mathematically spoken, the tangent of the curve at <span +class="cmmi-10">x </span>goes through <span +class="cmmi-10">c</span>. Similarly, the curve ends at <span +class="cmmi-10">y</span>, + “coming from” the other control point, <span +class="cmmi-10">d</span>. The larger the distance between <span +class="cmmi-10">x </span>and <span +class="cmmi-10">c </span>and between <span +class="cmmi-10">d</span> + and <span +class="cmmi-10">y</span>, the larger the curve will be. + <!--l. 470--><p class="noindent">If the “<span class="obeylines-h"><span class="verb"><span +class="cmtt-10">and</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">d</span><span +class="cmsy-10">></span>” part is not given, <span +class="cmmi-10">d </span>is assumed to be equal to <span +class="cmmi-10">c</span>. + <!--l. 473--><p class="noindent"><div class="obeylines-v"></div><object data="pgfmanual-122.svg" width="152.26372pt" height="38.45274pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-118-" ><colgroup id="TBL-118-1g"><col +id="TBL-118-1"></colgroup><tr + valign="baseline" id="TBL-118-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-118-1-1" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[line</span><span +class="cmtt-8"> width=10pt]</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> ..</span><span +class="cmtt-8"> controls</span><span +class="cmtt-8"> (1,1)</span><span +class="cmtt-8"> ..</span><span +class="cmtt-8"> (4,0)</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> ..</span><span +class="cmtt-8"> controls</span><span +class="cmtt-8"> (5,0)</span><span +class="cmtt-8"> and</span><span +class="cmtt-8"> (5,1)</span><span +class="cmtt-8"> ..</span><span +class="cmtt-8"> (4,1);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[color=gray]</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (1,1)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (4,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (5,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (5,1)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (4,1);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + <!--l. 481--><p class="noindent">As with the line-to operation, it makes a difference whether two curves are joined because they resulted + from consecutive curve-to or line-to operations, or whether they just happen to have the same + ending: + <!--l. 485--><p class="noindent"><div class="obeylines-v"></div><object data="pgfmanual-123.svg" width="152.26372pt" height="47.67911pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-119-" ><colgroup id="TBL-119-1g"><col +id="TBL-119-1"></colgroup><tr + valign="baseline" id="TBL-119-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-119-1-1" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}[line</span><span +class="cmtt-8"> width=10pt]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (1,1)</span><span +class="cmtt-8"> (1,1)</span><span +class="cmtt-8"> ..</span><span +class="cmtt-8"> controls</span><span +class="cmtt-8"> (1,0)</span><span +class="cmtt-8"> and</span><span +class="cmtt-8"> (2,0)</span><span +class="cmtt-8"> ..</span><span +class="cmtt-8"> (2,0);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (3,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (4,1)</span><span +class="cmtt-8"> ..</span><span +class="cmtt-8"> controls</span><span +class="cmtt-8"> (4,0)</span><span +class="cmtt-8"> and</span><span +class="cmtt-8"> (5,0)</span><span +class="cmtt-8"> ..</span><span +class="cmtt-8"> (5,0);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \useasboundingbox</span><span +class="cmtt-8"> (0,1.5);</span><span +class="cmtt-8"> </span><span +class="cmsltt-10x-x-80">%</span><span +class="cmsltt-10x-x-80"> make</span><span +class="cmsltt-10x-x-80"> bounding</span><span +class="cmsltt-10x-x-80"> box</span><span +class="cmsltt-10x-x-80"> higher</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + </dd></dl> +<!--l. 495--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">9.4 </span> <a + id="x10-1040009.4"></a>The Cycle Operation</h4> +<!--l. 497--><p class="noindent"> + <dl class="description"><dt class="description"> +<span +class="colorbox" id="colorbox40"><span id="textcolor41"><span +class="cmtt-10">\path</span> ...</span> <span +class="cmtt-10">--cycle</span> <span id="textcolor42">...<span +class="cmtt-10">;</span></span></span> </dt><dd +class="description"> +<a + id="dx10-104001"></a> +<a + id="dx10-104002"></a> + <!--l. 498--><p class="noindent">This operation adds a straight line from the current point to the last point specified by a move-to + operation. Note that this need not be the beginning of the path. Furthermore, a smooth join is created + between the first segment created after the last move-to operation and the straight line appended by + the cycle operation. + <!--l. 504--><p class="noindent">Consider the following example. In the left example, two triangles are created using three straight lines, + but they are not joined at the ends. In the second example cycle operations are used. + <!--l. 508--><p class="noindent"><div class="obeylines-v"></div><object data="pgfmanual-124.svg" width="237.62195pt" height="47.67911pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-120-" ><colgroup id="TBL-120-1g"><col +id="TBL-120-1"></colgroup><tr + valign="baseline" id="TBL-120-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-120-1-1" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}[line</span><span +class="cmtt-8"> width=10pt]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (1,1)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (1,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> (2,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (3,1)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (3,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (2,0);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (5,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (6,1)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (6,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> cycle</span><span +class="cmtt-8"> (7,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (8,1)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (8,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> cycle;</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \useasboundingbox</span><span +class="cmtt-8"> (0,1.5);</span><span +class="cmtt-8"> </span><span +class="cmsltt-10x-x-80">%</span><span +class="cmsltt-10x-x-80"> make</span><span +class="cmsltt-10x-x-80"> bounding</span><span +class="cmsltt-10x-x-80"> box</span><span +class="cmsltt-10x-x-80"> higher</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table> + </div> + </dd></dl> + + +<!--l. 519--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">9.5 </span> <a + id="x10-1050009.5"></a>The Rectangle Operation</h4> +<!--l. 521--><p class="noindent">A rectangle can obviously be created using four straight lines and a cycle operation. However, since rectangles are +needed so often, a special syntax is available for them. +<!--l. 525--><p class="indent"> + <dl class="description"><dt class="description"> +<span +class="colorbox" id="colorbox43"><span id="textcolor44"><span +class="cmtt-10">\path</span> ...</span> <span +class="cmtt-10">rectangle</span><span +class="cmsy-10"><</span><span +class="cmti-10">corner</span><span +class="cmsy-10">></span> <span id="textcolor45">...<span +class="cmtt-10">;</span></span></span> </dt><dd +class="description"> +<a + id="dx10-105001"></a> +<a + id="dx10-105002"></a> + <!--l. 526--><p class="noindent">When this operation is used, one corner will be the current point, another corner is given by <span +class="cmsy-10"><</span><span +class="cmti-10">corner</span><span +class="cmsy-10">></span>, + which becomes the new current point. + <!--l. 530--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-121-" ><colgroup id="TBL-121-1g"><col +id="TBL-121-1"><col +id="TBL-121-2"></colgroup><tr + valign="baseline" id="TBL-121-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-121-1-1" +class="td11"> <object data="pgfmanual-125.svg" width="99.98459pt" height="43.0791pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-121-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"><br> +<span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> rectangle</span><span +class="cmtt-8"> (1,1);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (.5,1)</span><span +class="cmtt-8"> rectangle</span><span +class="cmtt-8"> (2,0.5)</span><span +class="cmtt-8"> (3,0)</span><span +class="cmtt-8"> rectangle</span><span +class="cmtt-8"> (3.5,1.5)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (2,0);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + </dd></dl> +<!--l. 539--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">9.6 </span> <a + id="x10-1060009.6"></a>Rounding Corners</h4> +<!--l. 541--><p class="noindent">All of the path construction operations mentioned up to now are influenced by the following option: + <ul class="itemize1"> + <li class="itemize"><span +class="cmtt-10">rounded corners</span><a + id="dx10-106001"></a><a + id="dx10-106002"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">inset</span><span +class="cmsy-10">></span> When this option is in force, all corners (places where a line is continued + either via line-to or a curve-to operation) are replaced by little arcs so that the corner becomes smooth. + <!--l. 549--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-122-" ><colgroup id="TBL-122-1g"><col +id="TBL-122-1"><col +id="TBL-122-2"></colgroup><tr + valign="baseline" id="TBL-122-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-122-1-1" +class="td11"> <object data="pgfmanual-126.svg" width="114.21097pt" height="28.85274pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-122-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\tikz</span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> [rounded</span><span +class="cmtt-8"> corners]</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (1,1)</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (2,0)</span><span +class="cmtt-8"> ..</span><span +class="cmtt-8"> controls</span><span +class="cmtt-8"> (3,1)</span><span +class="cmtt-8"> ..</span><span +class="cmtt-8"> (4,0);</span></div> </td></tr></table> </td> +</tr></table></div> + <!--l. 554--><p class="noindent">The <span +class="cmsy-10"><</span><span +class="cmti-10">inset</span><span +class="cmsy-10">> </span>describes how big the corner is. Note that the <span +class="cmsy-10"><</span><span +class="cmti-10">inset</span><span +class="cmsy-10">> </span>is <span +class="cmti-10">not </span>scaled along if you use a scaling option + like <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">scale=2</span></span></span>. + <!--l. 558--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-123-" ><colgroup id="TBL-123-1g"><col +id="TBL-123-1"><col +id="TBL-123-2"></colgroup><tr + valign="baseline" id="TBL-123-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-123-1-1" +class="td11"> <object data="pgfmanual-127.svg" width="40.4pt" height="25.4pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-123-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[color=gray,very</span><span +class="cmtt-8"> thin]</span><span +class="cmtt-8"> (10pt,15pt)</span><span +class="cmtt-8"> circle</span><span +class="cmtt-8"> (10pt);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[rounded</span><span +class="cmtt-8"> corners=10pt]</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (0pt,25pt)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (40pt,25pt);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + <!--l. 565--><p class="noindent">You can switch the rounded corners on and off “in the middle of path” and different corners in the same path + can have different corner radii: + <!--l. 569--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-124-" ><colgroup id="TBL-124-1g"><col +id="TBL-124-1"><col +id="TBL-124-2"></colgroup><tr + valign="baseline" id="TBL-124-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-124-1-1" +class="td11"> <object data="pgfmanual-128.svg" width="57.30548pt" height="28.85274pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-124-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> [rounded</span><span +class="cmtt-8"> corners=10pt]</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (1,1)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (2,1)</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> [sharp</span><span +class="cmtt-8"> corners]</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (2,0)</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> [rounded</span><span +class="cmtt-8"> corners=5pt]</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> cycle;</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + <!--l. 577--><p class="noindent">Here is a rectangle with rounded corners: + + + <!--l. 578--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-125-" ><colgroup id="TBL-125-1g"><col +id="TBL-125-1"><col +id="TBL-125-2"></colgroup><tr + valign="baseline" id="TBL-125-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-125-1-1" +class="td11"> <object data="pgfmanual-129.svg" width="20.4pt" height="9.01108pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-125-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\tikz</span><span +class="cmtt-8"> \draw[rounded</span><span +class="cmtt-8"> corners=1ex]</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> rectangle</span><span +class="cmtt-8"> (20pt,2ex);</span></div> </td></tr></table> </td> +</tr></table> + </div> + <!--l. 582--><p class="noindent">You should be aware, that there are several pitfalls when using this option. First, the rounded corner will only + be an arc (part of a circle) if the angle is 90<sup ><span +class="cmsy-7"><span class="htf-cmbx">o</span></span></sup>. In other cases, the rounded corner will still be round, but “not + as nice.” + <!--l. 587--><p class="noindent">Second, if there are very short line segments in a path, the “rounding” may cause inadverted effects. In such + case it may be necessary to temporarily switch off the rounding using <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">sharp</span><span +class="cmtt-10"> corners</span></span></span>. + </li> + <li class="itemize"><span +class="cmtt-10">sharp corners</span><a + id="dx10-106003"></a><a + id="dx10-106004"></a> This options switches off any rounding on subsequent corners of the path.</li></ul> +<!--l. 599--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">9.7 </span> <a + id="x10-1070009.7"></a>The Circle and Ellipse Operations</h4> +<!--l. 601--><p class="noindent">A circle can be approximated well using four Bézier curves. However, it is difficult to do so correctly. For +this reason, a special syntax is available for adding such an approximation of a circle to the current +path. +<!--l. 606--><p class="indent"> + <dl class="description"><dt class="description"> +<span +class="colorbox" id="colorbox46"><span id="textcolor47"><span +class="cmtt-10">\path</span> ...</span> <span +class="cmtt-10">circle</span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">(</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">radius</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">)</span></span></span> <span id="textcolor48">...<span +class="cmtt-10">;</span></span></span> </dt><dd +class="description"> +<a + id="dx10-107001"></a> +<a + id="dx10-107002"></a> + <!--l. 607--><p class="noindent">The center of the circle is given by the current point. The new current point of the path will remain + to be the center of the circle. </dd></dl> +<!--l. 612--><p class="indent"> + <dl class="description"><dt class="description"> +<span +class="colorbox" id="colorbox49"><span id="textcolor50"><span +class="cmtt-10">\path</span> ...</span> <span +class="cmtt-10">ellipse</span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">(</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">half width</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"> <span +class="cmtt-10">and </span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">half height</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">)</span></span></span> <span id="textcolor51">...<span +class="cmtt-10">;</span></span></span> </dt><dd +class="description"> +<a + id="dx10-107003"></a> +<a + id="dx10-107004"></a> + <!--l. 613--><p class="noindent">Note that you can add spaces after <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">ellipse</span></span></span>, but you have to place spaces around <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">and</span></span></span>. + <!--l. 616--><p class="noindent"><div class="obeylines-v"></div><object data="pgfmanual-130.svg" width="220.90874pt" height="35.9659pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-126-" ><colgroup id="TBL-126-1g"><col +id="TBL-126-1"></colgroup><tr + valign="baseline" id="TBL-126-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-126-1-1" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (1,0)</span><span +class="cmtt-8"> circle</span><span +class="cmtt-8"> (.5cm);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (3,0)</span><span +class="cmtt-8"> ellipse</span><span +class="cmtt-8"> (1cm</span><span +class="cmtt-8"> and</span><span +class="cmtt-8"> .5cm)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> ++(3,0)</span><span +class="cmtt-8"> circle</span><span +class="cmtt-8"> (.5cm)</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> ++(2,-.5)</span><span +class="cmtt-8"> circle</span><span +class="cmtt-8"> (.25cm);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table> + </div> + </dd></dl> +<!--l. 626--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">9.8 </span> <a + id="x10-1080009.8"></a>The Arc Operation</h4> +<!--l. 628--><p class="noindent">The <span +class="cmti-10">arc operation </span>allows you to add an arc to the current path. + <dl class="description"><dt class="description"> +<span +class="colorbox" id="colorbox52"><span id="textcolor53"><span +class="cmtt-10">\path</span> ...</span> <span +class="cmtt-10">arc</span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">(</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">start angle</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">:</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">end angle</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">:</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">radius</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">/</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">half height</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">)</span></span></span> <span id="textcolor54">...<span +class="cmtt-10">;</span></span></span> </dt><dd +class="description"> +<a + id="dx10-108001"></a> +<a + id="dx10-108002"></a> + <!--l. 632--><p class="noindent">The arc operation adds a part of a circle of the given radius between the given angles. The arc will + start at the current point and will end at the end of the arc. + + + <!--l. 636--><p class="noindent"><div class="obeylines-v"></div><object data="pgfmanual-131.svg" width="228.02194pt" height="43.07912pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-127-" ><colgroup id="TBL-127-1g"><col +id="TBL-127-1"></colgroup><tr + valign="baseline" id="TBL-127-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-127-1-1" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> arc</span><span +class="cmtt-8"> (180:90:1cm)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (2,.5)</span><span +class="cmtt-8"> arc</span><span +class="cmtt-8"> (90:0:1cm);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (4,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> +(30:1cm)</span><span +class="cmtt-8"> arc</span><span +class="cmtt-8"> (30:60:1cm)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> cycle;</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (8,0)</span><span +class="cmtt-8"> arc</span><span +class="cmtt-8"> (0:270:1cm/.5cm)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> cycle;</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table> + </div> + <!--l. 644--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-128-" ><colgroup id="TBL-128-1g"><col +id="TBL-128-1"><col +id="TBL-128-2"></colgroup><tr + valign="baseline" id="TBL-128-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-128-1-1" +class="td11"> <object data="pgfmanual-132.svg" width="106.58725pt" height="57.3055pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-128-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (-1,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> +(3.5,0);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (1,0)</span><span +class="cmtt-8"> ++(210:2cm)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> +(30:4cm);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (1,0)</span><span +class="cmtt-8"> +(0:1cm)</span><span +class="cmtt-8"> arc</span><span +class="cmtt-8"> (0:30:1cm);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (1,0)</span><span +class="cmtt-8"> +(180:1cm)</span><span +class="cmtt-8"> arc</span><span +class="cmtt-8"> (180:210:1cm);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \path</span><span +class="cmtt-8"> (1,0)</span><span +class="cmtt-8"> ++(15:.75cm)</span><span +class="cmtt-8"> node{$\alpha$};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \path</span><span +class="cmtt-8"> (1,0)</span><span +class="cmtt-8"> ++(15:-.75cm)</span><span +class="cmtt-8"> node{$\beta$};</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + </dd></dl> +<!--l. 657--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">9.9 </span> <a + id="x10-1090009.9"></a>The Grid Operation</h4> +<!--l. 659--><p class="noindent">You can add a grid to the current path using the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">grid</span></span></span> path operation. +<!--l. 662--><p class="indent"> + <dl class="description"><dt class="description"> +<span +class="colorbox" id="colorbox55"><span id="textcolor56"><span +class="cmtt-10">\path</span> ...</span> <span +class="cmtt-10">grid</span><span +class="cmtt-10">[</span><span +class="cmsy-10"><</span><span +class="cmti-10">options</span><span +class="cmsy-10">></span><span +class="cmtt-10">]</span><span +class="cmsy-10"><</span><span +class="cmti-10">corner</span><span +class="cmsy-10">></span> <span id="textcolor57">...<span +class="cmtt-10">;</span></span></span> </dt><dd +class="description"> +<a + id="dx10-109001"></a> +<a + id="dx10-109002"></a> + <!--l. 663--><p class="noindent">This operations adss a grid filling a rectangle whose two corners are given by <span +class="cmsy-10"><</span><span +class="cmti-10">corner</span><span +class="cmsy-10">> </span>and by the + previous coordinate. Thus, the typical way in which a grid is drawn is <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">\draw</span><span +class="cmtt-10"> (1,1)</span><span +class="cmtt-10"> grid</span><span +class="cmtt-10"> (3,3);</span></span></span>, + which yields a grid filling the rectangle whose corners are at (1<span +class="cmmi-10">,</span>1) and (3<span +class="cmmi-10">,</span>3). All coordinate + transformations apply to the grid. + <!--l. 669--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"> +<table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-129-" ><colgroup id="TBL-129-1g"><col +id="TBL-129-1"><col +id="TBL-129-2"></colgroup><tr + valign="baseline" id="TBL-129-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-129-1-1" +class="td11"> <object data="pgfmanual-133.svg" width="78.13446pt" height="78.13446pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-129-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\tikz[rotate=30]</span><span +class="cmtt-8"> \draw[step=1mm]</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> grid</span><span +class="cmtt-8"> (2,2);</span></div> </td></tr></table> </td> +</tr></table></div> + <!--l. 673--><p class="noindent">The stepping of the grid is governed by the following options: + <ul class="itemize1"> + <li class="itemize"><span +class="cmtt-10">step</span><a + id="dx10-109003"></a><a + id="dx10-109004"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>sets the stepping in both the <span +class="cmmi-10">x </span>and <span +class="cmmi-10">y</span>-direction. + </li> + <li class="itemize"><span +class="cmtt-10">xstep</span><a + id="dx10-109005"></a><a + id="dx10-109006"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>sets the stepping in the <span +class="cmmi-10">x</span>-direction. + </li> + <li class="itemize"><span +class="cmtt-10">ystep</span><a + id="dx10-109007"></a><a + id="dx10-109008"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>sets the stepping in the <span +class="cmmi-10">y</span>-direction.</li></ul> + + + <!--l. 684--><p class="noindent">It is important to note that the grid is always “phased” such that it contains the point (0<span +class="cmmi-10">,</span>0) if that point + happens to be inside the rectangle. Thus, the grid does <span +class="cmti-10">not </span>always have an intersection at the corner points; + this occurs only if the corner points are multiples of the stepping. Note that due to rounding errors, the + “last” lines of a grid may be omitted. In this case, you have to add an epsilon to the corner + points. + <!--l. 692--><p class="noindent">The following style is useful for drawing grids: + <ul class="itemize1"> + <li class="itemize"><span +class="cmtt-10">style=</span><span +class="cmtt-10">help lines</span><a + id="dx10-109009"></a><a + id="dx10-109010"></a> This style makes lines “subdued” by using thin gray lines for them. However, this + style is not installed automatically and you have to say for example: + <!--l. 698--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"> +<table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-130-" ><colgroup id="TBL-130-1g"><col +id="TBL-130-1"><col +id="TBL-130-2"></colgroup><tr + valign="baseline" id="TBL-130-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-130-1-1" +class="td11"> <object data="pgfmanual-134.svg" width="85.55821pt" height="85.55821pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-130-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\tikz</span><span +class="cmtt-8"> \draw[style=help</span><span +class="cmtt-8"> lines]</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> grid</span><span +class="cmtt-8"> (3,3);</span></div> </td></tr></table> </td> +</tr></table></div> + </li></ul> + </dd></dl> +<!--l. 706--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">9.10 </span> <a + id="x10-1100009.10"></a>The Parabola Operation</h4> +<!--l. 708--><p class="noindent">The <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">parabola</span></span></span> path operation continues the current path with a parabola. A parabola is a (shifted and scaled) curve +defined by the equation <span +class="cmmi-10">f</span>(<span +class="cmmi-10">x</span>) = <span +class="cmmi-10">x</span><sup ><span +class="cmr-7">2</span></sup> and looks like this: <object data="pgfmanual-135.svg" width="9.01108pt" height="6.8583pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object>. +<!--l. 714--><p class="indent"> + <dl class="description"><dt class="description"> +<span +class="colorbox" id="colorbox58"><span id="textcolor59"><span +class="cmtt-10">\path</span> ...</span> <span +class="cmtt-10">parabola</span><span +class="cmtt-10">[</span><span +class="cmsy-10"><</span><span +class="cmti-10">options</span><span +class="cmsy-10">></span><span +class="cmtt-10">]</span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">bend</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">bend coordinate</span><span +class="cmsy-10">></span><span +class="cmsy-10"><</span><span +class="cmti-10">coordinate</span><span +class="cmsy-10">></span> <span id="textcolor60">...<span +class="cmtt-10">;</span></span></span> </dt><dd +class="description"> +<a + id="dx10-110001"></a> +<a + id="dx10-110002"></a> + <!--l. 715--><p class="noindent">This operation adds a parabola through the current point and the given <span +class="cmsy-10"><</span><span +class="cmti-10">coordinate</span><span +class="cmsy-10">></span>. If the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">bend</span></span></span> is + given, it specifies where the bend should go; the <span +class="cmsy-10"><</span><span +class="cmti-10">options</span><span +class="cmsy-10">> </span>can also be used to specify where the bend + is. By default, the bend is at the old current point. + <!--l. 720--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-131-" ><colgroup id="TBL-131-1g"><col +id="TBL-131-1"><col +id="TBL-131-2"></colgroup><tr + valign="baseline" id="TBL-131-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-131-1-1" +class="td11"> <object data="pgfmanual-136.svg" width="114.211pt" height="50.19229pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-131-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> rectangle</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (1,1.5)</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> parabola</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (1,1.5);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[xshift=1.5cm]</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> rectangle</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (1,1.5)</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> parabola[bend</span><span +class="cmtt-8"> at</span><span +class="cmtt-8"> end]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (1,1.5);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[xshift=3cm]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> rectangle</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (1,1.5)</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> parabola</span><span +class="cmtt-8"> bend</span><span +class="cmtt-8"> (.75,1.75)</span><span +class="cmtt-8"> (1,1.5);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + <!--l. 731--><p class="noindent">The following options influence parabolas: + <ul class="itemize1"> + <li class="itemize"><span +class="cmtt-10">bend</span><a + id="dx10-110003"></a><a + id="dx10-110004"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">coordinate</span><span +class="cmsy-10">> </span>Has the same effect as saying <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">bend</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">coordinate</span><span +class="cmsy-10">> </span>outside the <span +class="cmsy-10"><</span><span +class="cmti-10">options</span><span +class="cmsy-10">></span>. The + option specifies that the bend of the parabola should be at the given <span +class="cmsy-10"><</span><span +class="cmti-10">coordinate</span><span +class="cmsy-10">></span>. You have to + take care yourself that the bend position is a “valid” position; which means that if there is no + parabola of the form <span +class="cmmi-10">f</span>(<span +class="cmmi-10">x</span>) = <span +class="cmmi-10">ax</span><sup ><span +class="cmr-7">2</span></sup> +<span +class="cmmi-10">bx</span>+<span +class="cmmi-10">c </span>that goes through the old current point, the given bend, + and the new current point, the result will not be a parabola. + + + <!--l. 742--><p class="noindent">There is one special property of the <span +class="cmsy-10"><</span><span +class="cmti-10">coordinate</span><span +class="cmsy-10">></span>: When a relative coordinate is given like <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">+(0,0)</span></span></span>, + the position relative to which this coordinate is “flexible.” More precisely, this position lies + somewhere on a line from the old current point to the new current point. The exact position + depends on the next option. + </li> + <li class="itemize"><span +class="cmtt-10">bend pos</span><a + id="dx10-110005"></a><a + id="dx10-110006"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">fraction</span><span +class="cmsy-10">> </span>Specifies where the “previous” point is relative to which the bend is + calculated. The previous point will be at the <span +class="cmsy-10"><</span><span +class="cmti-10">fraction</span><span +class="cmsy-10">></span>th part of the line from the old current + point to the new current point. + <!--l. 755--><p class="noindent">The idea is the following: If you say <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">bend</span><span +class="cmtt-10"> pos=0</span></span></span> and <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">bend</span><span +class="cmtt-10"> +(0,0)</span></span></span>, the bend will be at the old + current point. If you say <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">bend</span><span +class="cmtt-10"> pos=1</span></span></span> and <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">bend</span><span +class="cmtt-10"> +(0,0)</span></span></span>, the bend will be at the new current + point. If you say <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">bend</span><span +class="cmtt-10"> pos=0.5</span></span></span> and <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">bend</span><span +class="cmtt-10"> +(0,2cm)</span></span></span> the bend will be 2cm above the middle + of the line between the start and end point. This is most useful in situations such as the + following: + <!--l. 761--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-132-" ><colgroup id="TBL-132-1g"><col +id="TBL-132-1"><col +id="TBL-132-2"></colgroup><tr + valign="baseline" id="TBL-132-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-132-1-1" +class="td11"> <object data="pgfmanual-137.svg" width="114.11096pt" height="57.30548pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-132-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[help</span><span +class="cmtt-8"> lines]</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> grid</span><span +class="cmtt-8"> (3,2);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (-1,0)</span><span +class="cmtt-8"> parabola[bend</span><span +class="cmtt-8"> pos=0.5]</span><span +class="cmtt-8"> bend</span><span +class="cmtt-8"> +(0,2)</span><span +class="cmtt-8"> +(3,0);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + <!--l. 768--><p class="noindent">In the above example, the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">bend</span><span +class="cmtt-10"> +(0,2)</span></span></span> essentially means “a parabola that is 2cm high” and + <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">+(3,0)</span></span></span> means “and 3cm wide.” Since this situation arises often, there is a special shortcut + option: + </li> + <li class="itemize"><span +class="cmtt-10">parabola height</span><a + id="dx10-110007"></a><a + id="dx10-110008"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>This option has the same effect as if you had written the following + instead: <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">[bend</span><span +class="cmtt-10"> pos=0.5,bend={+(0pt,</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">)}]</span></span></span>. + <!--l. 775--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-133-" ><colgroup id="TBL-133-1g"><col +id="TBL-133-1"><col +id="TBL-133-2"></colgroup><tr + valign="baseline" id="TBL-133-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-133-1-1" +class="td11"> <object data="pgfmanual-138.svg" width="114.11096pt" height="57.3055pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-133-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[help</span><span +class="cmtt-8"> lines]</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> grid</span><span +class="cmtt-8"> (3,2);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (-1,0)</span><span +class="cmtt-8"> parabola[parabola</span><span +class="cmtt-8"> height=2cm]</span><span +class="cmtt-8"> +(3,0);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + </li></ul> + <!--l. 783--><p class="noindent">The following styles are useful shortcuts: + <ul class="itemize1"> + <li class="itemize"><span +class="cmtt-10">style=</span><span +class="cmtt-10">bend at start</span><a + id="dx10-110009"></a><a + id="dx10-110010"></a> This places the bend at the start of a parabola. It is a shortcut for the + following options: <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">bend</span><span +class="cmtt-10"> pos=0,bend={+(0,0)}</span></span></span>. + </li> + <li class="itemize"><span +class="cmtt-10">style=</span><span +class="cmtt-10">bend at end</span><a + id="dx10-110011"></a><a + id="dx10-110012"></a> This places the bend at the end of a parabola.</li></ul> + </dd></dl> +<!--l. 794--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">9.11 </span> <a + id="x10-1110009.11"></a>The Sine and Cosine Operation</h4> +<!--l. 796--><p class="noindent">The <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">sin</span></span></span> and <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">cos</span></span></span> operations are similar to the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">parabola</span></span></span> operation. They, too, can be used to draw (parts of) a sine +or cosine curve. +<!--l. 800--><p class="indent"> + + + <dl class="description"><dt class="description"> +<span +class="colorbox" id="colorbox61"><span id="textcolor62"><span +class="cmtt-10">\path</span> ...</span> <span +class="cmtt-10">sin</span><span +class="cmsy-10"><</span><span +class="cmti-10">coordinate</span><span +class="cmsy-10">></span> <span id="textcolor63">...<span +class="cmtt-10">;</span></span></span> </dt><dd +class="description"> +<a + id="dx10-111001"></a> +<a + id="dx10-111002"></a> + <!--l. 801--><p class="noindent">The effect of <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">sin</span></span></span> is to draw a scaled and shifted version of a sine curve in the interval [0<span +class="cmmi-10">,<img +src="cmmi10-19.gif" alt="p" class="10x-x-19" />/</span>2]. The + scaling and shifting is done in such a way that the start of the sine curve in the interval is at the old + current point and that the end of the curve in the interval is at <span +class="cmsy-10"><</span><span +class="cmti-10">coordinate</span><span +class="cmsy-10">></span>. Here is an example that + should clarify this: + <!--l. 807--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-134-" ><colgroup id="TBL-134-1g"><col +id="TBL-134-1"><col +id="TBL-134-2"></colgroup><tr + valign="baseline" id="TBL-134-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-134-1-1" +class="td11"> <object data="pgfmanual-139.svg" width="101.97649pt" height="28.85274pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-134-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\tikz</span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> rectangle</span><span +class="cmtt-8"> (1,1)</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> sin</span><span +class="cmtt-8"> (1,1)</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (2,0)</span><span +class="cmtt-8"> rectangle</span><span +class="cmtt-8"> +(1.57,1)</span><span +class="cmtt-8"> (2,0)</span><span +class="cmtt-8"> sin</span><span +class="cmtt-8"> +(1.57,1);</span></div> </td></tr></table> </td> +</tr></table></div> + </dd></dl> +<!--l. 813--><p class="indent"> + <dl class="description"><dt class="description"> +<span +class="colorbox" id="colorbox64"><span id="textcolor65"><span +class="cmtt-10">\path</span> ...</span> <span +class="cmtt-10">cos</span><span +class="cmsy-10"><</span><span +class="cmti-10">coordinate</span><span +class="cmsy-10">></span> <span id="textcolor66">...<span +class="cmtt-10">;</span></span></span> </dt><dd +class="description"> +<a + id="dx10-111003"></a> +<a + id="dx10-111004"></a> + <!--l. 814--><p class="noindent">This operation works similarly, only a cosine in the interval [0<span +class="cmmi-10">,<img +src="cmmi10-19.gif" alt="p" class="10x-x-19" />/</span>2] is drawn. By correctly alternating + <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">sin</span></span></span> and <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">cos</span></span></span> operations, you can create a complete sine or cosine curve: + <!--l. 818--><p class="noindent"><div class="obeylines-v"></div><object data="pgfmanual-140.svg" width="223.75502pt" height="85.75821pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-135-" ><colgroup id="TBL-135-1g"><col +id="TBL-135-1"></colgroup><tr + valign="baseline" id="TBL-135-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-135-1-1" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}[xscale=1.57]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> sin</span><span +class="cmtt-8"> (1,1)</span><span +class="cmtt-8"> cos</span><span +class="cmtt-8"> (2,0)</span><span +class="cmtt-8"> sin</span><span +class="cmtt-8"> (3,-1)</span><span +class="cmtt-8"> cos</span><span +class="cmtt-8"> (4,0)</span><span +class="cmtt-8"> sin</span><span +class="cmtt-8"> (5,1);</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[color=red]</span><span +class="cmtt-8"> (0,1.5)</span><span +class="cmtt-8"> cos</span><span +class="cmtt-8"> (1,0)</span><span +class="cmtt-8"> sin</span><span +class="cmtt-8"> (2,-1.5)</span><span +class="cmtt-8"> cos</span><span +class="cmtt-8"> (3,0)</span><span +class="cmtt-8"> sin</span><span +class="cmtt-8"> (4,1.5)</span><span +class="cmtt-8"> cos</span><span +class="cmtt-8"> (5,0);</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table> + </div> + </dd></dl> +<!--l. 826--><p class="indent"> Note that there is no way to (conveniently) draw an interval on a sine or cosine curve whose end points are not +multiples of <span +class="cmmi-10"><img +src="cmmi10-19.gif" alt="p" class="10x-x-19" />/</span>2. +<!--l. 831--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">9.12 </span> <a + id="x10-1120009.12"></a>The Plot Operation</h4> +<!--l. 833--><p class="noindent">The <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot</span></span></span> operation can be used to append a line or curve to the path that goes through a large number of +coordinates. These coordinates are either given in a simple list of coordinates or they are read from some +file. +<!--l. 838--><p class="indent"> The syntax of the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot</span></span></span> comes in different versions. +<!--l. 840--><p class="indent"> + <dl class="description"><dt class="description"> +<span +class="colorbox" id="colorbox67"><span id="textcolor68"><span +class="cmtt-10">\path</span> ...</span> <span +class="cmtt-10">--plot</span><span +class="cmsy-10"><</span><span +class="cmti-10">further arguments</span><span +class="cmsy-10">></span> <span id="textcolor69">...<span +class="cmtt-10">;</span></span></span> </dt><dd +class="description"> +<a + id="dx10-112001"></a> +<a + id="dx10-112002"></a> + <!--l. 841--><p class="noindent">This operation plots the curve through the coordinates specified in the <span +class="cmsy-10"><</span><span +class="cmti-10">further arguments</span><span +class="cmsy-10">></span>. The current + (sub)path is simply continued, that is, a line-to operation to the first point of the curve is implicitly + added. The details of the <span +class="cmsy-10"><</span><span +class="cmti-10">further arguments</span><span +class="cmsy-10">> </span>will be explained in a moment. </dd></dl> +<!--l. 848--><p class="indent"> + + + <dl class="description"><dt class="description"> +<span +class="colorbox" id="colorbox70"><span id="textcolor71"><span +class="cmtt-10">\path</span> ...</span> <span +class="cmtt-10">plot</span><span +class="cmsy-10"><</span><span +class="cmti-10">further arguments</span><span +class="cmsy-10">></span> <span id="textcolor72">...<span +class="cmtt-10">;</span></span></span> </dt><dd +class="description"> +<a + id="dx10-112003"></a> +<a + id="dx10-112004"></a> + <!--l. 849--><p class="noindent">This operation plots the curve through the coordinates specified in the <span +class="cmsy-10"><</span><span +class="cmti-10">further arguments</span><span +class="cmsy-10">> </span>by first + “moving” to the first coordinate of the curve. </dd></dl> +<!--l. 854--><p class="indent"> The <span +class="cmsy-10"><</span><span +class="cmti-10">further arguments</span><span +class="cmsy-10">> </span>are used in three different ways to specifying the coordinates of the points to be +plotted: +<!--l. 857--><p class="indent"> + <ol type="1" class="enumerate1" > + <li class="enumerate" value="1" +><a + id="x10-112006x1"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">--</span></span></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot</span></span></span><span +class="cmtt-10">[</span><span +class="cmsy-10"><</span><span +class="cmti-10">local options</span><span +class="cmsy-10">></span><span +class="cmtt-10">]</span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">coordinates{</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">coordinate 1</span><span +class="cmsy-10">><</span><span +class="cmti-10">coordinate 2</span><span +class="cmsy-10">></span>...<span +class="cmsy-10"><</span><span +class="cmti-10">coordinate </span><span +class="cmmi-10">n</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">}</span></span></span> + </li> + <li class="enumerate" value="2" +><a + id="x10-112008x2"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">--</span></span></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot</span></span></span><span +class="cmtt-10">[</span><span +class="cmsy-10"><</span><span +class="cmti-10">local options</span><span +class="cmsy-10">></span><span +class="cmtt-10">]</span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">file{</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">filename</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">}</span></span></span> + </li> + <li class="enumerate" value="3" +><a + id="x10-112010x3"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">--</span></span></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot</span></span></span><span +class="cmtt-10">[</span><span +class="cmsy-10"><</span><span +class="cmti-10">local options</span><span +class="cmsy-10">></span><span +class="cmtt-10">]</span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">function{</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">gnuplot formula</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">}</span></span></span></li></ol> +<!--l. 867--><p class="indent"> These different ways are explained in the following. +<!--l. 870--><p class="noindent"> + <h5 class="subsubsectionHead"><span class="titlemark">9.12.1 </span> <a + id="x10-1130009.12.1"></a>Plotting Points Given Inline</h5> +<!--l. 872--><p class="noindent">In the first two cases, the points are given directly in the <span class="TEX">T<span +class="E">E</span>X</span>-file as in the following example: +<!--l. 875--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"> +<table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-136-" ><colgroup id="TBL-136-1g"><col +id="TBL-136-1"><col +id="TBL-136-2"></colgroup><tr + valign="baseline" id="TBL-136-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-136-1-1" +class="td11"> <object data="pgfmanual-141.svg" width="85.75822pt" height="28.85274pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-136-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\tikz</span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> plot</span><span +class="cmtt-8"> coordinates</span><span +class="cmtt-8"> {(0,0)</span><span +class="cmtt-8"> (1,1)</span><span +class="cmtt-8"> (2,0)</span><span +class="cmtt-8"> (3,1)</span><span +class="cmtt-8"> (2,1)</span><span +class="cmtt-8"> (10:2cm)};</span></div> </td></tr></table> </td> +</tr></table></div> +<!--l. 879--><p class="indent"> Here is an example showing the difference between <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot</span></span></span> and <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">--plot</span></span></span>: +<!--l. 881--><p class="noindent"><div class="obeylines-v"></div><object data="pgfmanual-142.svg" width="256.47475pt" height="28.85274pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-137-" ><colgroup id="TBL-137-1g"><col +id="TBL-137-1"></colgroup><tr + valign="baseline" id="TBL-137-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-137-1-1" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (1,1)</span><span +class="cmtt-8"> plot</span><span +class="cmtt-8"> coordinates</span><span +class="cmtt-8"> {(2,0)</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (4,0)};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[color=red,xshift=5cm]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (1,1)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> plot</span><span +class="cmtt-8"> coordinates</span><span +class="cmtt-8"> {(2,0)</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> (4,0)};</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table> +</div> +<!--l. 890--><p class="noindent"> + <h5 class="subsubsectionHead"><span class="titlemark">9.12.2 </span> <a + id="x10-1140009.12.2"></a>Plotting Points Read From an External File</h5> +<!--l. 892--><p class="noindent">The second way of specifying points is to put them in an external file named <span +class="cmsy-10"><</span><span +class="cmti-10">filename</span><span +class="cmsy-10">></span>. Currently, the only file +format that Ti<span +class="cmti-10">k</span>Z allows is the following: Each line of the <span +class="cmsy-10"><</span><span +class="cmti-10">filename</span><span +class="cmsy-10">> </span>should contain one line starting with two +numbers, separated by a space. Anything following the two numbers on the line is ignored. Also, lines starting with +a <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">%</span></span></span> or a <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">#</span></span></span> are ignored as well as empty lines. (This is exactly the format that <span +class="cmcsc-10"><small +class="small-caps">G</small><small +class="small-caps">N</small><small +class="small-caps">U</small><small +class="small-caps">P</small><small +class="small-caps">L</small><small +class="small-caps">O</small><small +class="small-caps">T</small> </span>produces when you say +<span class="obeylines-h"><span class="verb"><span +class="cmtt-10">set</span><span +class="cmtt-10"> terminal</span><span +class="cmtt-10"> table</span></span></span>.) If necessary, more formats will be supported in the future, but it is usually easy to produce a +file containing data in this form. +<!--l. 903--><p class="noindent"><div class="obeylines-v"></div><object data="pgfmanual-143.svg" width="287.35587pt" height="59.72435pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-138-" ><colgroup id="TBL-138-1g"><col +id="TBL-138-1"></colgroup><tr + valign="baseline" id="TBL-138-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-138-1-1" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\tikz</span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> plot[mark=x,smooth]</span><span +class="cmtt-8"> file</span><span +class="cmtt-8"> {plots/pgfmanual-sine.table};</span></div> </td></tr></table> </td></tr></table> +</div> +<!--l. 907--><p class="indent"> The file <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plots/pgfmanual-sine.table</span></span></span> reads: + + +<!--l. 908--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-139-" ><colgroup id="TBL-139-1g"><col +id="TBL-139-1"></colgroup><tr + valign="baseline" id="TBL-139-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-139-1-1" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">#Curve</span><span +class="cmtt-8"> 0,</span><span +class="cmtt-8"> 20</span><span +class="cmtt-8"> points</span> +<br><span +class="cmtt-8">#x</span><span +class="cmtt-8"> y</span><span +class="cmtt-8"> type</span> +<br><span +class="cmtt-8">0.00000</span><span +class="cmtt-8"> 0.00000</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> i</span> +<br><span +class="cmtt-8">0.52632</span><span +class="cmtt-8"> 0.50235</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> i</span> +<br><span +class="cmtt-8">1.05263</span><span +class="cmtt-8"> 0.86873</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> i</span> +<br><span +class="cmtt-8">1.57895</span><span +class="cmtt-8"> 0.99997</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> i</span> +<br><span +class="cmtt-8">...</span> +<br><span +class="cmtt-8">9.47368</span><span +class="cmtt-8"> -0.04889</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> i</span> +<br><span +class="cmtt-8">10.00000</span><span +class="cmtt-8"> -0.54402</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> i</span></div> </td></tr></table> </td> +</tr></table></div> +<!--l. 919--><p class="indent"> It was produced from the following source, using <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">gnuplot</span></span></span>: +<!--l. 920--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-140-" ><colgroup id="TBL-140-1g"><col +id="TBL-140-1"></colgroup><tr + valign="baseline" id="TBL-140-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-140-1-1" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">set</span><span +class="cmtt-8"> terminal</span><span +class="cmtt-8"> table</span> +<br><span +class="cmtt-8">set</span><span +class="cmtt-8"> output</span><span +class="cmtt-8"> "../plots/pgfmanual-sine.table"</span> +<br><span +class="cmtt-8">set</span><span +class="cmtt-8"> format</span><span +class="cmtt-8"> "</span><span +class="cmsltt-10x-x-80">%.5f"</span> +<br><span +class="cmtt-8">set</span><span +class="cmtt-8"> samples</span><span +class="cmtt-8"> 20</span> +<br><span +class="cmtt-8">plot</span><span +class="cmtt-8"> [x=0:10]</span><span +class="cmtt-8"> sin(x)</span></div> </td></tr></table> </td> +</tr></table></div> +<!--l. 928--><p class="indent"> The <span +class="cmsy-10"><</span><span +class="cmti-10">local options</span><span +class="cmsy-10">> </span>of the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot</span></span></span> operation are local to each plot and do not affect other plots “on the same path.” +For example, <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot[yshift=1cm]</span></span></span> will locally shift the plot 1cm upward. Remember, however, that most +options can only be applied to paths as a whole. For example, <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot[red]</span></span></span> does not have the effect of +making the plot red. After all, you are trying to “locally” make part of the path red, which is not +possible. +<!--l. 936--><p class="noindent"> + <h5 class="subsubsectionHead"><span class="titlemark">9.12.3 </span> <a + id="x10-1150009.12.3"></a>Plotting a Function</h5> +<!--l. 939--><p class="noindent">Often, you will want to plot points that are given via a function like <span +class="cmmi-10">f</span>(<span +class="cmmi-10">x</span>) = <span +class="cmmi-10">x</span>sin<span +class="cmmi-10">x</span>. Unfortunately, +<span class="TEX">T<span +class="E">E</span>X</span> does not really have enough computational power to generate the points on such a function +efficiently (it is a text processing program, after all). However, if you allow it, <span class="TEX">T<span +class="E">E</span>X</span> can try to call +external programs that can easily produce the necessary points. Currently, Ti<span +class="cmti-10">k</span>Z knows how to call +<span +class="cmcsc-10"><small +class="small-caps">G</small><small +class="small-caps">N</small><small +class="small-caps">U</small><small +class="small-caps">P</small><small +class="small-caps">L</small><small +class="small-caps">O</small><small +class="small-caps">T</small></span>. +<!--l. 947--><p class="indent"> When Ti<span +class="cmti-10">k</span>Z encounters your operation <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot[id=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">id</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">]</span><span +class="cmtt-10"> function{x*sin(x)}</span></span></span> for the first time, it will create a +file called <span +class="cmsy-10"><</span><span +class="cmti-10">prefix</span><span +class="cmsy-10">><</span><span +class="cmti-10">id</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.gnuplot</span></span></span>, where <span +class="cmsy-10"><</span><span +class="cmti-10">prefix</span><span +class="cmsy-10">> </span>is <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">\jobname.</span></span></span> by default, that is, the name of you main <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.tex</span></span></span> file. If +no <span +class="cmsy-10"><</span><span +class="cmti-10">id</span><span +class="cmsy-10">> </span>is given, it will be empty, which is alright, but it is better when each plot has a unique <span +class="cmsy-10"><</span><span +class="cmti-10">id</span><span +class="cmsy-10">> </span>for +reasons explained in a moment. Next, Ti<span +class="cmti-10">k</span>Z writes some initialization code into this file followed by +<span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot</span><span +class="cmtt-10"> x*sin(x)</span></span></span>. The initialization code sets up things such that the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot</span></span></span> operation will write the +coordinates into another file called <span +class="cmsy-10"><</span><span +class="cmti-10">prefix</span><span +class="cmsy-10">><</span><span +class="cmti-10">id</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.table</span></span></span>. Finally, this table file is read as if you had said +<span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot</span><span +class="cmtt-10"> file{</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">prefix</span><span +class="cmsy-10">><</span><span +class="cmti-10">id</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.table}</span></span></span>. +<!--l. 960--><p class="indent"> For the plotting mechanism to work, two conditions must be met: + <ol type="1" class="enumerate1" > + <li class="enumerate" value="1" +><a + id="x10-115002x1"></a>You must have allowed <span class="TEX">T<span +class="E">E</span>X</span> to call external programs. This is often switched off by default since this + is a security risk (you might, without knowing, run a <span class="TEX">T<span +class="E">E</span>X</span> file that calls all sorts of “bad” commands). + To enable this “calling external programs” a command line option must be given to the <span class="TEX">T<span +class="E">E</span>X</span> program. + Usually, it is called something like <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">shell-escape</span></span></span> or <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">enable-write18</span></span></span>. For example, for my <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">pdflatex</span></span></span> + the option <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">--shell-escape</span></span></span> can be given. + </li> + <li class="enumerate" value="2" +><a + id="x10-115004x2"></a>You must have installed the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">gnuplot</span></span></span> program and <span class="TEX">T<span +class="E">E</span>X</span> must find it when compiling your file.</li></ol> +<!--l. 976--><p class="indent"> Unfortunately, these conditions will not always be met. Especially if you pass some source to a +coauthor and the coauthor does not have <span +class="cmcsc-10"><small +class="small-caps">G</small><small +class="small-caps">N</small><small +class="small-caps">U</small><small +class="small-caps">P</small><small +class="small-caps">L</small><small +class="small-caps">O</small><small +class="small-caps">T</small> </span>installed, he or she will have trouble compiling your +files. +<!--l. 981--><p class="indent"> For this reason, Ti<span +class="cmti-10">k</span>Z behaves differently when you compile your graphic for the second time: If upon reaching +<span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot[id=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">id</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">]</span><span +class="cmtt-10"> function{...}</span></span></span> the file <span +class="cmsy-10"><</span><span +class="cmti-10">prefix</span><span +class="cmsy-10">><</span><span +class="cmti-10">id</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.table</span></span></span> already exists <span +class="cmti-10">and </span>if the <span +class="cmsy-10"><</span><span +class="cmti-10">prefix</span><span +class="cmsy-10">><</span><span +class="cmti-10">id</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.gnuplot</span></span></span> file +contains what Ti<span +class="cmti-10">k</span>Z thinks that it “should” contain, the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.table</span></span></span> file is immediately read without trying to call a +<span class="obeylines-h"><span class="verb"><span +class="cmtt-10">gnuplot</span></span></span> program. This approach has the following advantages: + <ol type="1" class="enumerate1" > + <li class="enumerate" value="1" +><a + id="x10-115006x1"></a>If you pass a bundle of your <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.tex</span></span></span> file and all <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.gnuplot</span></span></span> and <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.table</span></span></span> files to someone else, that person + can <span class="TEX">T<span +class="E">E</span>X</span> the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.tex</span></span></span> file without having to have <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">gnuplot</span></span></span> installed. + + + </li> + <li class="enumerate" value="2" +><a + id="x10-115008x2"></a>If the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">\write18</span></span></span> feature is switched off for security reasons (a good idea), then, upon the first compilation + of the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.tex</span></span></span> file, the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.gnuplot</span></span></span> will still be generated, but not the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.table</span></span></span> file. You can then simply call + <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">gnuplot</span></span></span> “by hand” for each <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.gnuplot</span></span></span> file, which will produce all necessary <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.table</span></span></span> files. + </li> + <li class="enumerate" value="3" +><a + id="x10-115010x3"></a>If you change the function that you wish to plot or its domain, Ti<span +class="cmti-10">k</span>Z will automatically try to regenerate + the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.table</span></span></span> file. + </li> + <li class="enumerate" value="4" +><a + id="x10-115012x4"></a>If, out of laziness, you do not provide an <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">id</span></span></span>, the same <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.gnuplot</span></span></span> will be used for different plots, but this + is not a problem since the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">.table</span></span></span> will automatically be regenerated for each plot on-the-fly. <span +class="cmti-10">Note: If</span> + <span +class="cmti-10">you intend to share your files with someone else, always use an id, so that the file can by typeset without</span> + <span +class="cmti-10">having </span><span +class="cmcsc-10"><small +class="small-caps">G</small><small +class="small-caps">N</small><small +class="small-caps">U</small><small +class="small-caps">P</small><small +class="small-caps">L</small><small +class="small-caps">O</small><small +class="small-caps">T</small> </span><span +class="cmti-10">installed. </span>Also, having unique ids for each plot will improve compilation speed since + no external programs need to be called, unless it is really necessary.</li></ol> +<!--l. 1014--><p class="indent"> When you use <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot</span><span +class="cmtt-10"> function{</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">gnuplot formula</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">}</span></span></span>, the <span +class="cmsy-10"><</span><span +class="cmti-10">gnuplot formula</span><span +class="cmsy-10">> </span>must be given in the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">gnuplot</span></span></span> syntax, +whose details are beyond the scope of this manual. Here is the ultra-condensed essence: Use <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">x</span></span></span> as the +variable and use the C-syntax for normal plots, use <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">t</span></span></span> as the variable for parametric plots. Here are some +examples: +<!--l. 1020--><p class="noindent"><div class="obeylines-v"></div><object data="pgfmanual-144.svg" width="186.39253pt" height="170.71059pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-141-" ><colgroup id="TBL-141-1g"><col +id="TBL-141-1"></colgroup><tr + valign="baseline" id="TBL-141-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-141-1-1" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}[domain=0:4]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[very</span><span +class="cmtt-8"> thin,color=gray]</span><span +class="cmtt-8"> (-0.1,-1.1)</span><span +class="cmtt-8"> grid</span><span +class="cmtt-8"> (3.9,3.9);</span> +<br> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[->]</span><span +class="cmtt-8"> (-0.2,0)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (4.2,0)</span><span +class="cmtt-8"> node[right]</span><span +class="cmtt-8"> {$x$};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[->]</span><span +class="cmtt-8"> (0,-1.2)</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> (0,4.2)</span><span +class="cmtt-8"> node[above]</span><span +class="cmtt-8"> {$f(x)$};</span> +<br> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[color=red]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> plot[id=x]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> function{x}</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> node[right]</span><span +class="cmtt-8"> {$f(x)</span><span +class="cmtt-8"> =x$};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[color=blue]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> plot[id=sin]</span><span +class="cmtt-8"> function{sin(x)}</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> node[right]</span><span +class="cmtt-8"> {$f(x)</span><span +class="cmtt-8"> =</span><span +class="cmtt-8"> \sin</span><span +class="cmtt-8"> x$};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[color=orange]</span><span +class="cmtt-8"> plot[id=exp]</span><span +class="cmtt-8"> function{0.05*exp(x)}</span><span +class="cmtt-8"> node[right]</span><span +class="cmtt-8"> {$f(x)</span><span +class="cmtt-8"> =</span><span +class="cmtt-8"> \frac{1}{20}</span><span +class="cmtt-8"> \mathrm</span><span +class="cmtt-8"> e^x$};</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> +<!--l. 1034--><p class="indent"> The following options influence the plot: + <ul class="itemize1"> + <li class="itemize"><span +class="cmtt-10">samples</span><a + id="dx10-115013"></a><a + id="dx10-115014"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">number</span><span +class="cmsy-10">> </span>sets the number of samples used in the plot. The default is 25. + </li> + <li class="itemize"><span +class="cmtt-10">domain</span><a + id="dx10-115015"></a><a + id="dx10-115016"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">start</span><span +class="cmsy-10">></span><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">:</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">end</span><span +class="cmsy-10">> </span>sets the domain between which the samples are taken. The default is <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">-5:5</span></span></span>. + </li> + <li class="itemize"><span +class="cmtt-10">parametric</span><a + id="dx10-115017"></a><a + id="dx10-115018"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">true or false</span><span +class="cmsy-10">></span> sets whether the plot is a parametric plot. If true, then <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">t</span></span></span> must be used instead of + <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">x</span></span></span> as the parameter and two comma-separated functions must be given in the <span +class="cmsy-10"><</span><span +class="cmti-10">gnuplot formula</span><span +class="cmsy-10">></span>. An example is + the following: + <!--l. 1047--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"> +<table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-142-" ><colgroup id="TBL-142-1g"><col +id="TBL-142-1"><col +id="TBL-142-2"></colgroup><tr + valign="baseline" id="TBL-142-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-142-1-1" +class="td11"> <object data="pgfmanual-145.svg" width="26.40906pt" height="89.77023pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-142-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\tikz</span><span +class="cmtt-8"> \draw[scale=0.5,domain=-3.141:3.141,smooth]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> plot[parametric,id=parametric-example]</span><span +class="cmtt-8"> function{t*sin(t),t*cos(t)};</span></div> </td></tr></table> </td> +</tr></table> + + + </div> + </li> + <li class="itemize"><span +class="cmtt-10">id</span><a + id="dx10-115019"></a><a + id="dx10-115020"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">id</span><span +class="cmsy-10">> </span>sets the identifier of the current plot. This should be a unique identifier for each plot (though things + will also work if it is not, but not as well, see the explanations above). The <span +class="cmsy-10"><</span><span +class="cmti-10">id</span><span +class="cmsy-10">> </span>will be part of a filename, so it + should not contain anything fancy like <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">*</span></span></span> or <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">$</span></span></span>. + </li> + <li class="itemize"><span +class="cmtt-10">prefix</span><a + id="dx10-115021"></a><a + id="dx10-115022"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">prefix</span><span +class="cmsy-10">> </span>is put before each plot file name. The default is <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">\jobname.</span></span></span>, but if you have many plots, it + might be better to use, say <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plots/</span></span></span> and have all plots placed in a directory. You have to create the directory + yourself. + </li> + <li class="itemize"><span +class="cmtt-10">raw gnuplot</span><a + id="dx10-115023"></a><a + id="dx10-115024"></a> causes the <span +class="cmsy-10"><</span><span +class="cmti-10">gnuplot formula</span><span +class="cmsy-10">> </span>to be passed on to <span +class="cmcsc-10"><small +class="small-caps">G</small><small +class="small-caps">N</small><small +class="small-caps">U</small><small +class="small-caps">P</small><small +class="small-caps">L</small><small +class="small-caps">O</small><small +class="small-caps">T</small> </span>without setting up the samples or the + <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot</span></span></span> operation. Thus, you could write + <!--l. 1067--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-143-" ><colgroup id="TBL-143-1g"><col +id="TBL-143-1"></colgroup><tr + valign="baseline" id="TBL-143-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-143-1-1" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">plot[raw</span><span +class="cmtt-8"> gnuplot,id=raw-example]</span><span +class="cmtt-8"> function{set</span><span +class="cmtt-8"> samples</span><span +class="cmtt-8"> 25;</span><span +class="cmtt-8"> plot</span><span +class="cmtt-8"> sin(x)}</span></div> </td></tr></table> </td> +</tr></table> + </div> + <!--l. 1070--><p class="noindent">This can be useful for complicated things that need to be passed to <span +class="cmcsc-10"><small +class="small-caps">G</small><small +class="small-caps">N</small><small +class="small-caps">U</small><small +class="small-caps">P</small><small +class="small-caps">L</small><small +class="small-caps">O</small><small +class="small-caps">T</small></span>. However, for really complicated + situations you should create a special external generating <span +class="cmcsc-10"><small +class="small-caps">G</small><small +class="small-caps">N</small><small +class="small-caps">U</small><small +class="small-caps">P</small><small +class="small-caps">L</small><small +class="small-caps">O</small><small +class="small-caps">T</small> </span>file and use the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">file</span></span></span>-syntax to include the + table “by hand.”</li></ul> +<!--l. 1077--><p class="indent"> The following styles influence the plot: + <ul class="itemize1"> + <li class="itemize"><span +class="cmtt-10">style=</span><span +class="cmtt-10">every plot</span><a + id="dx10-115025"></a><a + id="dx10-115026"></a> This style is installed in each plot, that is, as if you always said + <!--l. 1081--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-144-" ><colgroup id="TBL-144-1g"><col +id="TBL-144-1"></colgroup><tr + valign="baseline" id="TBL-144-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-144-1-1" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> plot[style=every</span><span +class="cmtt-8"> plot,...]</span></div> </td></tr></table> </td> +</tr></table> + </div> + <!--l. 1084--><p class="noindent">This is most useful for globally setting a prefix for all plots by saying: + <!--l. 1085--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-145-" ><colgroup id="TBL-145-1g"><col +id="TBL-145-1"></colgroup><tr + valign="baseline" id="TBL-145-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-145-1-1" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\tikzstyle{every</span><span +class="cmtt-8"> plot}=[prefix=plots/]</span></div> </td></tr></table> </td> +</tr></table> + </div> + </li></ul> +<!--l. 1092--><p class="noindent"> + <h5 class="subsubsectionHead"><span class="titlemark">9.12.4 </span> <a + id="x10-1160009.12.4"></a>Placing Marks on the Plot</h5> +<!--l. 1094--><p class="noindent">As we saw already, it is possible to add <span +class="cmti-10">marks </span>to a plot using the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">mark</span></span></span> option. When this option is used, a copy of +the plot mark is placed on each point of the plot. Note that the marks are placed <span +class="cmti-10">after </span>the whole path has been +drawn/filled/shaded. In this respect, they are handled like text nodes. +<!--l. 1100--><p class="indent"> In detail, the following options govern how marks are drawn: + <ul class="itemize1"> + <li class="itemize"><span +class="cmtt-10">mark</span><a + id="dx10-116001"></a><a + id="dx10-116002"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">mark mnemonic</span><span +class="cmsy-10">> </span>Sets the mark to a mnemonic that has previously been defined using the + <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">\pgfdeclareplotmark</span></span></span>. By default, <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">*</span></span></span>, <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">+</span></span></span>, and <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">x</span></span></span> are available, which draw a filled circle, a plus, and a + cross as marks. Many more marks become available when the library <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">pgflibraryplotmarks</span></span></span> is loaded. + Section <a +href="pgfmanualse14.html#x15-17100014.3.3">14.3.3<!--tex4ht:ref: section-plot-marks --></a> lists the available plot marks. + <!--l. 1110--><p class="noindent">One plot mark is special: the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">ball</span></span></span> plot mark is available only it Ti<span +class="cmti-10">k</span>Z. The <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">ball</span><span +class="cmtt-10"> color</span></span></span> determines the + balls’s color. Do not use this option with large number of marks since it will take very long to render + in PostScript. + <div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-146-" ><colgroup id="TBL-146-1g"><col +id="TBL-146-1"><col +id="TBL-146-2"></colgroup><tr + valign="baseline" id="TBL-146-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-146-1-1" +class="td11"> Option </td><td align="center" style="white-space:nowrap; text-align:center;" id="TBL-146-1-2" +class="td11"> Effect </td> +</tr><tr +class="hline"><td><hr></td><td><hr></td></tr><tr + valign="baseline" id="TBL-146-2-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-146-2-1" +class="td11"> <a + id="dx10-116003"></a><a + id="dx10-116004"></a> <span +class="cmtt-10">mark=</span><span +class="cmtt-10">ball</span> </td><td align="center" style="white-space:nowrap; text-align:center;" id="TBL-146-2-2" +class="td11"> <object data="pgfmanual-146.svg" width="46.67911pt" height="9.69046pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td> +</tr><tr + valign="baseline" id="TBL-146-3-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-146-3-1" +class="td11"> </td> +</tr></table></div> + + + </li> + <li class="itemize"><span +class="cmtt-10">mark size</span><a + id="dx10-116005"></a><a + id="dx10-116006"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>Sets the size of the plot marks. For circular plot marks, <span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>is the radius, for + other plot marks <span +class="cmsy-10"><</span><span +class="cmti-10">dimension</span><span +class="cmsy-10">> </span>should be about half the width and height. + <!--l. 1125--><p class="noindent">This option is not really necessary, since you achieve the same effect by specifying <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">scale=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">factor</span><span +class="cmsy-10">> </span>as a local + option, where <span +class="cmsy-10"><</span><span +class="cmti-10">factor</span><span +class="cmsy-10">> </span>is the quotient of the desired size and the default size. However, using <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">mark</span><span +class="cmtt-10"> size</span></span></span> is a + bit faster and more natural. + </li> + <li class="itemize"><span +class="cmtt-10">mark options</span><a + id="dx10-116007"></a><a + id="dx10-116008"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">options</span><span +class="cmsy-10">> </span>These options are applied to marks when they are drawn. For example, you can scale + (or otherwise transform) the plot mark or set its color. + <!--l. 1134--><p class="noindent"><div class="obeylines-v"></div><object data="pgfmanual-147.svg" width="287.99155pt" height="59.89592pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-147-" ><colgroup id="TBL-147-1g"><col +id="TBL-147-1"></colgroup><tr + valign="baseline" id="TBL-147-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-147-1-1" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\tikz</span><span +class="cmtt-8"> \fill[fill=blue!20]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> plot[mark=triangle*,mark</span><span +class="cmtt-8"> options={color=blue,rotate=180}]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> file{plots/pgfmanual-sine.table}</span><span +class="cmtt-8"> |-</span><span +class="cmtt-8"> (0,0);</span></div> </td></tr></table> </td> +</tr></table> + </div> + </li></ul> +<!--l. 1143--><p class="noindent"> + <h5 class="subsubsectionHead"><span class="titlemark">9.12.5 </span> <a + id="x10-1170009.12.5"></a>Smooth Plots, Sharp Plots, and Comb Plots</h5> +<!--l. 1145--><p class="noindent">There are different things the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot</span></span></span> operation can do with the points it reads from a file or from the inlined list of +points. By default, it will connect these points by straight lines. However, you can also use options to change the +behavior of <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot</span></span></span>. + <ul class="itemize1"> + <li class="itemize"><span +class="cmtt-10">sharp plot</span><a + id="dx10-117001"></a><a + id="dx10-117002"></a> This is the default and causes the points to be connected by straight lines. This option is + included only so that you can “switch back” if you “globally” install, say, <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">smooth</span></span></span>. + </li> + <li class="itemize"><span +class="cmtt-10">smooth</span><a + id="dx10-117003"></a><a + id="dx10-117004"></a> This option causes the points on the path to be connected using a smooth curve: + <!--l. 1160--><p class="noindent"><div class="obeylines-v"></div><object data="pgfmanual-148.svg" width="284.92743pt" height="57.5319pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-148-" ><colgroup id="TBL-148-1g"><col +id="TBL-148-1"></colgroup><tr + valign="baseline" id="TBL-148-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-148-1-1" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\tikz\draw</span><span +class="cmtt-8"> plot[smooth]</span><span +class="cmtt-8"> file{plots/pgfmanual-sine.table};</span></div> </td></tr></table> </td> +</tr></table> + </div> + <!--l. 1164--><p class="noindent">Note that the smoothing algorithm is not very intelligent. You will get the best results if the bending angles + are small, that is, less than about 30<sup ><span +class="cmsy-7"><span class="htf-cmbx">o</span></span></sup> and, even more importantly, if the distances between points are about + the same all over the plotting path. + </li> + <li class="itemize"><span +class="cmtt-10">tension</span><a + id="dx10-117005"></a><a + id="dx10-117006"></a><span class="obeylines-h"><span class="verb"><span +class="cmtt-10">=</span></span></span><span +class="cmsy-10"><</span><span +class="cmti-10">value</span><span +class="cmsy-10">> </span>This option influences how “tight” the smoothing is. A lower value will result in sharper + corners, a higher value in more “round” curves. A value of 1 results in a circle if four points at + quarter-positions on a circle are given. The default is 0<span +class="cmmi-10">.</span>55. The “correct” value depends on the details of + plot. + + + <!--l. 1176--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"> +<table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-149-" ><colgroup id="TBL-149-1g"><col +id="TBL-149-1"><col +id="TBL-149-2"></colgroup><tr + valign="baseline" id="TBL-149-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-149-1-1" +class="td11"> <object data="pgfmanual-149.svg" width="57.30548pt" height="185.34288pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-149-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}[smooth</span><span +class="cmtt-8"> cycle]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> plot[tension=0.2]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> coordinates{(0,0)</span><span +class="cmtt-8"> (1,1)</span><span +class="cmtt-8"> (2,0)</span><span +class="cmtt-8"> (1,-1)};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[yshift=-2.25cm]</span><span +class="cmtt-8"> plot[tension=0.5]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> coordinates{(0,0)</span><span +class="cmtt-8"> (1,1)</span><span +class="cmtt-8"> (2,0)</span><span +class="cmtt-8"> (1,-1)};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[yshift=-4.5cm]</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> plot[tension=1]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> coordinates{(0,0)</span><span +class="cmtt-8"> (1,1)</span><span +class="cmtt-8"> (2,0)</span><span +class="cmtt-8"> (1,-1)};</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + </li> + <li class="itemize"><span +class="cmtt-10">smooth cycle</span><a + id="dx10-117007"></a><a + id="dx10-117008"></a> This option causes the points on the path to be connected using a closed smooth + curve. + <!--l. 1191--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-150-" ><colgroup id="TBL-150-1g"><col +id="TBL-150-1"><col +id="TBL-150-2"></colgroup><tr + valign="baseline" id="TBL-150-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-150-1-1" +class="td11"> <object data="pgfmanual-150.svg" width="28.85274pt" height="34.77437pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-150-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\tikz[scale=0.5]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> plot[smooth</span><span +class="cmtt-8"> cycle]</span><span +class="cmtt-8"> coordinates{(0,0)</span><span +class="cmtt-8"> (1,0)</span><span +class="cmtt-8"> (2,1)</span><span +class="cmtt-8"> (1,2)}</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> plot</span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> coordinates{(0,0)</span><span +class="cmtt-8"> (1,0)</span><span +class="cmtt-8"> (2,1)</span><span +class="cmtt-8"> (1,2)}</span><span +class="cmtt-8"> --</span><span +class="cmtt-8"> cycle;</span></div> </td></tr></table> </td> +</tr></table></div> + </li> + <li class="itemize"><span +class="cmtt-10">ycomb</span><a + id="dx10-117009"></a><a + id="dx10-117010"></a> This option causes the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">plot</span></span></span> operation to interpret the plotting points differently. Instead of connecting + them, for each point of the plot a straight line is added to the path from the <span +class="cmmi-10">x</span>-axis to the point, resulting in a + sort of “comb” or “bar diagram.” + <!--l. 1203--><p class="noindent"><div class="obeylines-v"></div><object data="pgfmanual-151.svg" width="288.52744pt" height="60.89592pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-151-" ><colgroup id="TBL-151-1g"><col +id="TBL-151-1"></colgroup><tr + valign="baseline" id="TBL-151-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-151-1-1" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\tikz\draw[ultra</span><span +class="cmtt-8"> thick]</span><span +class="cmtt-8"> plot[ycomb,thin,mark=*]</span><span +class="cmtt-8"> file{plots/pgfmanual-sine.table};</span></div> </td></tr></table> </td> +</tr></table> + </div> + <!--l. 1207--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-152-" ><colgroup id="TBL-152-1g"><col +id="TBL-152-1"><col +id="TBL-152-2"></colgroup><tr + valign="baseline" id="TBL-152-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-152-1-1" +class="td11"> <object data="pgfmanual-152.svg" width="64.90549pt" height="41.98865pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-152-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\begin{tikzpicture}[ycomb]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[color=red,line</span><span +class="cmtt-8"> width=6pt]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> plot</span><span +class="cmtt-8"> coordinates{(0,1)</span><span +class="cmtt-8"> (.5,1.2)</span><span +class="cmtt-8"> (1,.6)</span><span +class="cmtt-8"> (1.5,.7)</span><span +class="cmtt-8"> (2,.9)};</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> \draw[color=red!50,line</span><span +class="cmtt-8"> width=4pt,xshift=3pt]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> plot</span><span +class="cmtt-8"> coordinates{(0,1.2)</span><span +class="cmtt-8"> (.5,1.3)</span><span +class="cmtt-8"> (1,.5)</span><span +class="cmtt-8"> (1.5,.2)</span><span +class="cmtt-8"> (2,.5)};</span> +<br><span +class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> +</tr></table></div> + </li> + <li class="itemize"><span +class="cmtt-10">xcomb</span><a + id="dx10-117011"></a><a + id="dx10-117012"></a> This option works like <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">ycomb</span></span></span> except that the bars are horizontal. + + + <!--l. 1219--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-153-" ><colgroup id="TBL-153-1g"><col +id="TBL-153-1"><col +id="TBL-153-2"></colgroup><tr + valign="baseline" id="TBL-153-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-153-1-1" +class="td11"> <object data="pgfmanual-153.svg" width="30.06696pt" height="31.28117pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-153-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\tikz</span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> plot[xcomb,mark=x]</span><span +class="cmtt-8"> coordinates{(1,0)</span><span +class="cmtt-8"> (0.8,0.2)</span><span +class="cmtt-8"> (0.6,0.4)</span><span +class="cmtt-8"> (0.2,1)};</span></div> </td></tr></table> </td> +</tr></table></div> + </li> + <li class="itemize"><span +class="cmtt-10">polar comb</span><a + id="dx10-117013"></a><a + id="dx10-117014"></a> This option causes a line from the origin to the point to be added to the path for each plot + point. + <!--l. 1227--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"> +<table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-154-" ><colgroup id="TBL-154-1g"><col +id="TBL-154-1"><col +id="TBL-154-2"></colgroup><tr + valign="baseline" id="TBL-154-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-154-1-1" +class="td11"> <object data="pgfmanual-154.svg" width="64.03284pt" height="82.04958pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-154-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\tikz</span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> plot[polar</span><span +class="cmtt-8"> comb,</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> mark=pentagon*,mark</span><span +class="cmtt-8"> options={fill=white,draw=red},mark</span><span +class="cmtt-8"> size=4pt]</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> </span><span +class="cmtt-8"> coordinates</span><span +class="cmtt-8"> {(0:1cm)</span><span +class="cmtt-8"> (30:1.5cm)</span><span +class="cmtt-8"> (160:.5cm)</span><span +class="cmtt-8"> (250:2cm)</span><span +class="cmtt-8"> (-60:.8cm)};</span></div> </td></tr></table> </td> +</tr></table></div> + </li> + <li class="itemize"><span +class="cmtt-10">only marks</span><a + id="dx10-117015"></a><a + id="dx10-117016"></a> This option causes only marks to be shown; no path segments are added to the actual path. This + can be useful for quickly adding some marks to a path. + <!--l. 1239--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"> +<table class="tabular" +cellspacing="0" cellpadding="0" +frame="void" id="TBL-155-" ><colgroup id="TBL-155-1g"><col +id="TBL-155-1"><col +id="TBL-155-2"></colgroup><tr + valign="baseline" id="TBL-155-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-155-1-1" +class="td11"> <object data="pgfmanual-155.svg" width="88.18666pt" height="59.73392pt" type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-155-1-2" +class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> +<br><span +class="cmtt-8">\tikz</span><span +class="cmtt-8"> \draw</span><span +class="cmtt-8"> (0,0)</span><span +class="cmtt-8"> sin</span><span +class="cmtt-8"> (1,1)</span><span +class="cmtt-8"> cos</span><span +class="cmtt-8"> (2,0)</span> +<br><span +class="cmtt-8"> </span><span +class="cmtt-8"> plot[only</span><span +class="cmtt-8"> marks,mark=x]</span><span +class="cmtt-8"> coordinates{(0,0)</span><span +class="cmtt-8"> (1,1)</span><span +class="cmtt-8"> (2,0)</span><span +class="cmtt-8"> (3,-1)};</span></div> </td></tr></table> </td> +</tr></table></div> + </li></ul> +<!--l. 1249--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">9.13 </span> <a + id="x10-1180009.13"></a>The Scoping Operation</h4> +<!--l. 1251--><p class="noindent">When Ti<span +class="cmti-10">k</span>Z encounters and opening or a closing brace (<span class="obeylines-h"><span class="verb"><span +class="cmtt-10">{</span></span></span> or <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">}</span></span></span>) at some point where a path operation should come, +it will open or close a scope. All options that can be applied “locally” will be scoped inside the scope. For example, +if you apply a transformation like <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">[xshift=1cm]</span></span></span> inside the scoped area, the shifting only applies to the scope. On +the other hand, an option like <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">color=red</span></span></span> does not have any effect inside a scope since it can only be applied to the +path as a whole. +<!--l. 1261--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">9.14 </span> <a + id="x10-1190009.14"></a>The Node Operation</h4> +<!--l. 1263--><p class="noindent">You can add nodes to a path using the <span class="obeylines-h"><span class="verb"><span +class="cmtt-10">node</span></span></span> operation. Since this operation is quite complex and since +the nodes are not really part of the path itself, there is a separate section dealing with nodes, see +Section <a +href="pgfmanualse11.html#x12-13600011">11<!--tex4ht:ref: section-nodes --></a>. + + + + + + + <div class="crosslinks"><p class="noindent">[<a +href="pgfmanualse10.html" >next</a>] [<a +href="pgfmanualse8.html" >prev</a>] [<a +href="pgfmanualse8.html#tailpgfmanualse8.html" >prev-tail</a>] [<a +href="pgfmanualse9.html" >front</a>] [<a +href="pgfmanual.html#pgfmanualse9.html" >up</a>] </p></div> +<!--l. 8--><p class="indent"> <a + id="tailpgfmanualse9.html"></a> +</body></html> |