14 Libraries

14.1 Arrow Tip Library

\usepackage{pgflibraryarrows} % LATEX
\input pgflibraryarrows.tex % plain TEX
\input pgflibraryarrows.tex % ConTEXt

The package defines additional arrow tips, which are described below. See page 295 for the arrows tips that are defined by default. Note that neither the standard packages nor this package defines an arrow name containing > or <. These are left for the user to defined as he or she sees fit.

14.1.1 Triangular Arrow Tips
latex' yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

latex' reversed yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

stealth' yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

stealth' reversed yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

triangle 90 yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

triangle 90 reversed yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

triangle 60 yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

triangle 60 reversed yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

triangle 45 yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

triangle 45 reversed yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

open triangle 90 yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

open triangle 90 reversed yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

open triangle 60 yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

open triangle 60 reversed yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

open triangle 45 yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

open triangle 45 reversed yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

14.1.2 Barbed Arrow Tips
angle 90 yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

angle 90 reversed yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

angle 60 yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

angle 60 reversed yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

angle 45 yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

angle 45 reversed yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

hooks yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

hooks reversed yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

14.1.3 Bracket-Like Arrow Tips
[-] yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

]-[ yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

(-) yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

)-( yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

14.1.4 Circle and Diamond Arrow Tips
o yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

* yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

diamond yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

open diamond yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

14.1.5 Partial Arrow Tips
left to yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

left to reversed yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

right to yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

right to reversed yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

left hook yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

left hook reversed yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

right hook yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

right hook reversed yields thick

SVG-Viewer needed.

and thin

SVG-Viewer needed.

14.1.6 Line Caps
round cap yields for line width 1ex

SVG-Viewer needed.

butt cap yields for line width 1ex

SVG-Viewer needed.

triangle 90 cap yields for line width 1ex

SVG-Viewer needed.

triangle 90 cap reversed yields for line width 1ex

SVG-Viewer needed.

fast cap yields for line width 1ex

SVG-Viewer needed.

fast cap reversed yields for line width 1ex

SVG-Viewer needed.

14.2 Snake Library

\usepackage{pgflibrarysnakes} % LATEX
\input pgflibrarysnakes.tex % plain TEX
\input pgflibrarysnakes.tex % ConTEXt

This library package defines basic snakes. Section 9.2.3 explains how snakes are used in TikZ, Section 22 explains how new snakes can be defined.

The snakes are influenced by the current values of parameters like \pgfsnakesegmentamplitude. Only this parameter and \pgfsnakesegmentlength are proper TEX dimensions, all other parameters are TEX macros.

In TikZ, each parameter can be set using an option having the parameters name minus the \pgfsnake part.

Snake border

This snake adds straight lines the path that are at a specific angle to the line toward the target. The idea is to add these little lines to indicate the “border” or an area. The following parameters influence the snake:

 

SVG-Viewer needed.

 

\tikz{\draw (0,0) rectangle (3,1)
            [snake=border,segment angle=-45] (0,0) rectangle (3,1);}

Snake brace

This snake adds a long brace to the path. The left and right end of the brace will be exactly on the start and endpoint of the snake. The following parameters influence the snake:

 

SVG-Viewer needed.

 

\tikz{\draw[snake=brace,segment aspect=0.25] (0,0) -- (3,0);}

Snake bumps

This snake consists of little half ellipses. The following parameters influence the snake:

 

SVG-Viewer needed.

 

\tikz{\draw[snake=bumps] (0,0) -- (3,0);}

Snake coil

This snake adds a coil to the path. To understand how this works, imagine a three-dimensional spring. The spring’s axis points along the line toward the target. Then, we “view” the spring from a certain angle. If we look “straight from the side” we will see a perfect sine curve, if we look “more from the front” we will see a coil. The following parameters influence the snake:

 

SVG-Viewer needed.

 

\begin{tikzpicture}[segment amplitude=10pt]
  \draw[snake=coil]                  (0,1) -- (3,1);
  \draw[snake=coil,segment aspect=0] (0,0) -- (3,0);
\end{tikzpicture}

Snake expanding waves

This snake adds arcs to the path that get bigger along the line towards the target. The following parameters influence the snake:

 

SVG-Viewer needed.

 

\tikz{\draw[snake=expanding waves] (0,0) -- (3,0);}

Snake saw

This snake looks like the blade of a saw. The following parameters influence the snake:

 

SVG-Viewer needed.

 

\tikz{\draw[snake=saw] (0,0) -- (3,0);}

Snake snake

This snake is the “architypical” snake: It looks like a snake seen from above. More precisely, the snake is a sine wave with a “softened” start and ending. The following parameters influence the snake:

 

SVG-Viewer needed.

 

\tikz{\draw[snake=snake] (0,0) -- (3,0);}

Snake ticks

This snake adds straight lines the path that are orthogonal to the line toward the target. The following parameters influence the snake:

 

SVG-Viewer needed.

 

\tikz{\draw[snake=ticks] (0,0) -- (3,0);}

Snake triangles

This snake adds triangles to the path that point toward the target. The following parameters influence the snake:

 

SVG-Viewer needed.

 

\tikz{\draw[snake=triangles] (0,0) -- (3,0);}

Snake waves

This snake adds arcs to the path that have a constant size. The following parameters influence the snake:

 

SVG-Viewer needed.

 

\tikz{\draw[snake=waves] (0,0) -- (3,0);}

Snake zigzag

This snake looks like a zig-zag line. The following parameters influence the snake:

 

SVG-Viewer needed.

 

\tikz{\draw[snake=zigzag] (0,0) -- (3,0);}

14.3 Plot Handler Library

\usepackage{pgflibraryplothandlers} % LATEX
\input pgflibraryplothandlers.tex % plain TEX
\input pgflibraryplothandlers.tex % ConTEXt

This library packages defines additional plot handlers, see Section 29.3 for an introduction to plot handlers. The additional handlers are described in the following.

14.3.1 Curve Plot Handlers

\pgfplothandlercurveto

This handler will issue a \pgfpathcurveto command for each point of the plot, except possibly for the first. As for the line-to handler, what happens with the first point can be specified using \pgfsetmovetofirstplotpoint or \pgfsetlinetofirstplotpoint.

Obviously, the \pgfpathcurveto command needs, in addition to the points on the path, some control points. These are generated automatically using a somewhat “dumb” algorithm: Suppose you have three points x, y, and z on the curve such that y is between x and z:

 

SVG-Viewer needed.

 

\begin{tikzpicture}
  \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
  \pgfplothandlercurveto
  \pgfplotstreamstart
  \pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
  \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
  \pgfplotstreampoint{\pgfpoint{2cm}{.5cm}}
  \pgfplotstreamend
  \pgfusepath{stroke}
\end{tikzpicture}

In order to determine the control points of the curve at the point y, the handler computes the vector z - x and scales it by the tension factor (see below). Let us call the resulting vector s. Then y + s and y - s will be the control points around y. The first control point at the beginning of the curve will be the beginning itself, once more; likewise the last control point is the end itself.

\pgfsetplottension{<value>}

Sets the factor used by the curve plot handlers to determine the distance of the control points from the points they control. The higher the curvature of the curve points, the higher this value should be. A value of 1 will cause four points at quarter positions of a circle to be connected using a circle. The default is 0.5.

 

SVG-Viewer needed.

 

\begin{tikzpicture}
  \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
  \pgfsetplottension{0.75}
  \pgfplothandlercurveto
  \pgfplotstreamstart
  \pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
  \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
  \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}}
  \pgfplotstreamend
  \pgfusepath{stroke}
\end{tikzpicture}

\pgfplothandlerclosedcurve

This handler works like the curve-to plot handler, only it will add a new part to the current path that is a closed curve through the plot points.

 

SVG-Viewer needed.

 

\begin{tikzpicture}
  \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
  \pgfplothandlerclosedcurve
  \pgfplotstreamstart
  \pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
  \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
  \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}}
  \pgfplotstreamend
  \pgfusepath{stroke}
\end{tikzpicture}

14.3.2 Comb Plot Handlers

There are three “comb” plot handlers. There name stems from the fact that the plots they produce look like “combs” (more or less).

\pgfplothandlerxcomb

This handler converts each point in the plot stream into a line from the y-axis to the point’s coordinate, resulting in a “horizontal comb.”

 

SVG-Viewer needed.

 

\begin{tikzpicture}
  \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
  \pgfplothandlerxcomb
  \pgfplotstreamstart
  \pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
  \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
  \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}}
  \pgfplotstreamend
  \pgfusepath{stroke}
\end{tikzpicture}

\pgfplothandlerycomb

This handler converts each point in the plot stream into a line from the x-axis to the point’s coordinate, resulting in a “vertical comb.”

This handler is useful for creating “bar diagrams.”

 

SVG-Viewer needed.

 

\begin{tikzpicture}
  \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
  \pgfplothandlerycomb
  \pgfplotstreamstart
  \pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
  \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
  \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}}
  \pgfplotstreamend
  \pgfusepath{stroke}
\end{tikzpicture}

\pgfplothandlerpolarcomb

This handler converts each point in the plot stream into a line from the origin to the point’s coordinate.

 

SVG-Viewer needed.

 

\begin{tikzpicture}
  \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
  \pgfplothandlerpolarcomb
  \pgfplotstreamstart
  \pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
  \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
  \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}}
  \pgfplotstreamend
  \pgfusepath{stroke}
\end{tikzpicture}

14.3.3 Mark Plot Handler

\pgfplothandlermark{<mark code>}

This command will execute the <mark code> for each point of the plot, but each time the coordinate transformation matrix will be setup such that the origin is at the position of the point to be plotted. This way, if the <mark code> draws a little circle around the origin, little circles will be drawn at each point of the plot.

 

SVG-Viewer needed.

 

\begin{tikzpicture}
  \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
  \pgfplothandlermark{\pgfpathcircle{\pgfpointorigin}{4pt}\pgfusepath{stroke}}
  \pgfplotstreamstart
  \pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
  \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
  \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}}
  \pgfplotstreamend
  \pgfusepath{stroke}
\end{tikzpicture}

Typically, the <code> will be \pgfuseplotmark{<plot mark name>}, where <plot mark name> is the name of a predefined plot mark.

\pgfuseplotmark{<plot mark name>}

Draws the given <plot mark name> at the origin. The <plot mark name> must previously have been declared using \pgfdeclareplotmark.

 

SVG-Viewer needed.

 

\begin{tikzpicture}
  \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
  \pgfplothandlermark{\pgfuseplotmark{pentagon}}
  \pgfplotstreamstart
  \pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
  \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
  \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}}
  \pgfplotstreamend
  \pgfusepath{stroke}
\end{tikzpicture}

\pgfdeclareplotmark{<plot mark name>}{<code>}

Declares a plot mark for later used with the \pgfuseplotmark command.

 

SVG-Viewer needed.

 

\pgfdeclareplotmark{my plot mark}
  {\pgfpathcircle{\pgfpoint{0cm}{1ex}}{1ex}\pgfusepathqstroke}
\begin{tikzpicture}
  \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
  \pgfplothandlermark{\pgfuseplotmark{my plot mark}}
  \pgfplotstreamstart
  \pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
  \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
  \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}}
  \pgfplotstreamend
  \pgfusepath{stroke}
\end{tikzpicture}

\pgfsetplotmarksize{<dimension>}

This command sets the TEX dimension \pgfplotmarksize to <dimension>. This dimension is a “recommendation” for plot mark code at which size the plot mark should be drawn; plot mark code may choose to ignore this <dimension> altogether. For circles, <dimension> should be the radius, for other shapes it should be about half the width/height.

The predefined plot marks all take this dimension into account.

 

SVG-Viewer needed.

 

\begin{tikzpicture}
  \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
  \pgfsetplotmarksize{1ex}
  \pgfplothandlermark{\pgfuseplotmark{*}}
  \pgfplotstreamstart
  \pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
  \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
  \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}}
  \pgfplotstreamend
  \pgfusepath{stroke}
\end{tikzpicture}

\pgfplotmarksize

A TEX dimension that is a “recommendation” for the size of plot marks.

The following plot marks are predefined (the filling color has been set to yellow):

\pgfuseplotmark{*}

SVG-Viewer needed.

\pgfuseplotmark{x}

SVG-Viewer needed.

\pgfuseplotmark{+}

SVG-Viewer needed.

14.4 Plot Mark Library

\usepackage{pgflibraryplotmarks} % LATEX
\input pgflibraryplotmarks.tex % plain TEX
\input pgflibraryplotmarks.tex % ConTEXt

When this package is loaded, the following plot marks are defined in addition to *, x, and + (the filling color has been set to a dark yellow):

\pgfuseplotmark{-}

SVG-Viewer needed.

\pgfuseplotmark{|}

SVG-Viewer needed.

\pgfuseplotmark{o}

SVG-Viewer needed.

\pgfuseplotmark{asterisk}

SVG-Viewer needed.

\pgfuseplotmark{star}

SVG-Viewer needed.

\pgfuseplotmark{oplus}

SVG-Viewer needed.

\pgfuseplotmark{oplus*}

SVG-Viewer needed.

\pgfuseplotmark{otimes}

SVG-Viewer needed.

\pgfuseplotmark{otimes*}

SVG-Viewer needed.

\pgfuseplotmark{square}

SVG-Viewer needed.

\pgfuseplotmark{square*}

SVG-Viewer needed.

\pgfuseplotmark{triangle}

SVG-Viewer needed.

\pgfuseplotmark{triangle*}

SVG-Viewer needed.

\pgfuseplotmark{diamond}

SVG-Viewer needed.

\pgfuseplotmark{diamond*}

SVG-Viewer needed.

\pgfuseplotmark{pentagon}

SVG-Viewer needed.

\pgfuseplotmark{pentagon*}

SVG-Viewer needed.

14.5 Shape Library

\usepackage{pgflibraryshapes} % LATEX
\input pgflibraryshapes.tex % plain TEX
\input pgflibraryshapes.tex % ConTEXt

This library packages defines additional shapes, which are described in the following.

Shape cross out

This shape “crosses out” the node. Its foreground path are simply two diagonal lines that between the corners of the node’s bounding box. Here is an example:

 

SVG-Viewer needed.

 

\begin{tikzpicture}
  \draw[help lines] (0,0) grid (3,2);
  \node [cross out,draw=red] at (1.5,1) {cross out};
\end{tikzpicture}

A useful application is inside text as in the following example:

 Cross

SVG-Viewer needed.

out!  

Cross \tikz[baseline] \node [cross out,draw,anchor=text] {me}; out!

This shape inherits all anchors from the rectangle shape, see also the following figure:

SVG-Viewer needed.


\Huge
\begin{tikzpicture}
  \node[name=s,shape=cross out,style=shape example] {cross out\vrule width 1pt height 2cm};
  \foreach \anchor/\placement in
    {north west/above left, north/above, north east/above right,
     west/left, center/above, east/right,
     mid west/right, mid/above, mid east/left,
     base west/left, base/below, base east/right,
     south west/below left, south/below, south east/below right,
     text/left, 10/right, 130/above}
     \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
       node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}

Shape ellipse

This shape is an ellipse tightly fitting the text box, if no inner separation is given. The following figure shows the anchors this shape defines; the anchors 10 and 130 are example of border anchors.

SVG-Viewer needed.


\Huge
\begin{tikzpicture}
  \node[name=s,shape=ellipse,style=shape example] {Ellipse\vrule width 1pt height 2cm};
  \foreach \anchor/\placement in
    {north west/above left, north/above, north east/above right,
     west/left, center/above, east/right,
     mid west/right, mid/above, mid east/left,
     base west/left, base/below, base east/right,
     south west/below left, south/below, south east/below right,
     text/left, 10/right, 130/above}
     \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
       node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}

Shape forbidden sign

This shape places the node inside a circle with a diagonal from the lower left to the upper right added. The circle is part of the background, the diagonal line part of the foreground path; thus, the diagonal line is on top of the text.

 

SVG-Viewer needed.

 

\begin{tikzpicture}
  \node [forbidden sign,line width=1ex,draw=red,fill=white] {Smoking};
\end{tikzpicture}

The shape inherits all anchors from the circle shape, see also the following figure:

SVG-Viewer needed.


\Huge
\begin{tikzpicture}
  \node[name=s,shape=forbidden sign,style=shape example] {Forbidden\vrule width 1pt height 2cm};
  \foreach \anchor/\placement in
    {north west/above left, north/above, north east/above right,
     west/left, center/above, east/right,
     mid west/right, mid/above, mid east/left,
     base west/left, base/below, base east/right,
     south west/below left, south/below, south east/below right,
     text/left, 10/right, 130/above}
     \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
       node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}

Shape strike out

This shape is idential to the cross out shape, only its foreground path consists of a single line from the lower left to the upper right.

 Strike

SVG-Viewer needed.

out!  

Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!

See the cross out shape for the anchors.

14.6 Tree Library

\usepackage{pgflibrarytikztrees} % LATEX
\input pgflibrarytikztrees.tex % plain TEX
\input pgflibrarytikztrees.tex % ConTEXt

This packages defines styles to be used when drawing trees.

14.6.1 Growth Functions

The package pgflibrarytikztrees defines two new growth functions. They are installed using the following options:

14.6.2 Edges From Parent

The following styles can be used to modify how the edges from parents are drawn:

14.7 Background Library

\usepackage{pgflibrarytikzbackgrounds} % LATEX
\input pgflibrarytikzbackgrounds.tex % plain TEX
\input pgflibrarytikzbackgrounds.tex % ConTEXt

This packages defines “backgrounds” for pictures. This does not refer to background pictures, but rather to frames drawn around and behind pictures. For example, this package allows you to just add the framed option to a picture to get a rectangular box around your picture or gridded to put a grid behind your picture.

When this package is loaded, the following styles become available:

14.8 Automata Drawing Library

\usepackage{pgflibraryautomata} % LATEX
\input pgflibraryautomata.tex % plain TEX
\input pgflibraryautomata.tex % ConTEXt

This packages, which is still under construction, provides shapes and styles for drawing automata.

Shape state

This shape is currently just an alias for the circle shape. However, it is useful to have another shape state since one can then say, for example, the the style every state shape should be set to some special value.

Shape state with output

This shape is a multi-part shape. The main part (the text part) is the name of the state as in the state shape. The second part is called output. This node part is drawn in the lower part of the node, separated from the upper part by a line.

 

SVG-Viewer needed.

 

\begin{tikzpicture}
  \node [state with output,draw,double,fill=red!20]
  {
    $q_1$
    \nodepart{output}
    $00$
  };
\end{tikzpicture}

The shape inherits all anchors from the circle shape and defines the output anchor in addition. See also the following figure:

SVG-Viewer needed.


\Huge
\begin{tikzpicture}
  \node[name=s,shape=state with output,style=shape example] {state name\nodepart{output}output};
  \foreach \anchor/\placement in
    {north west/above left, north/above, north east/above right,
     west/left, center/below, east/right,
     mid west/right, mid/above, mid east/left,
     base west/left, base/below, base east/right,
     south west/below left, south/below, south east/below right,
     text/left, output/left, 130/above}
     \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
       node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}