%!TEX root = tzplot-doc.tex %\begin{document} %%%========================== \part{Points, Lines, and Curves} %%%========================== \label{p:linesandcurves} %%================================== \chapter{Getting Ready} \label{c:gettingready} %%------------------------------------------------------------ \section{Styles: \texttt{tzdotted}, \texttt{tzdashed}, \texttt{tzhelplines}} \label{s:styles:tzhelplines} The styles \ixttw{tzdotted}, \ixttw{tzdashed}, and \ixttw{tzhelplines} are defined as follows: \begin{tzsty} % styles: tzdotted, tzdashed, tzhelplines \tikzset{% tzdotted/.style={line cap=round,dash pattern=on 0pt off 1cm/(#1)}, tzdotted/.default=10 } \tikzset{% tzdashed/.style={dashed=none,dash pattern=on 5mm/(#1) off 5mm/(#1)}, tzdashed/.default=10 } \tikzset{% tzhelplines/.style={help lines,-,tzdotted} } \end{tzsty} The styles |tzdotted| and |tzdashed| print 10 dots and 10 dashes per 1cm, respectively, by default. The style |tzhelplines| uses |tzdotted| by default. %%------------------------------------------------------------ \section{\protect\cmd{\tzhelplines}, \protect\cmd{\tzhelplines*}} \label{s:tzhelplines} \icmd{\tzhelplines} draws |grid| from the first coordinate to the second coordinate. If only one coordinate is specified, then the first coordinate is regarded as |(0,0)|. The starred version \icmd{\tzhelplines*} uses the grid as a \iisw{bounding box}. \begin{tzdef} % syntax: minimum \tzhelplines() % syntax: full \tzhelplines[]()() % defaults [help lines,tzdotted=10]()() % (): mandatory argument \end{tzdef} Here, |(|\ixxw{}|)| stands for a \xem{mandatory} argument. \begin{tztikz} \tzhelplines(4,3) % works similarly to: \draw [help lines] (0,0) grid (4,3); \tzhelplines(1,1)(4,3) % works similarly to: \draw [help lines] (1,1) grid (4,3); \end{tztikz} By default, |\tzhelplines| prints |grid| with |10| dots per |1cm|. |\tzhelplines| with the option value |[tzdotted=]| prints || dots per |1cm|. (That is, the default value is |tzdotted=10|.) \begin{tzcode}{.3} % \tzhelplines \begin{tikzpicture} \tzhelplines(2,2) \draw [help lines] (3,0) grid (5,2); \end{tikzpicture} \end{tzcode} \begin{tzcode}{.3} % tzdotted: (default: 10 dots per 1cm) \begin{tikzpicture} \tzhelplines[thick](1,2) % 10 dots \tzhelplines[thick,tzdotted=20](2,0)(3,2) % 20 dots \tzhelplines[thick,tzdotted=5](4,0)(5,2) % 5 dots \end{tikzpicture} \end{tzcode} With the option value, |[tzdotted=/]|, |\tzhelplines| prints || dots per |cm|. Similarly for |tzdashed|. \begin{tzcode}{.3} % tzdotted, tzdashed \begin{tikzpicture} \tzhelplines[thick,tzdashed](4,2) \tzhelplines[thick,step=.5](4,2) \end{tikzpicture} \end{tzcode} \begin{tzcode}{.3} % scaled: 7 dots per .7cm (10 dots per hard 1cm) \begin{tikzpicture}[scale=.7] \tzhelplines[tzdashed](4,3) \tzhelplines[step=.5](4,3) \end{tikzpicture} \end{tzcode} \begin{tzcode}{.3} % scaled: 10/.7 means 10 dots per .7cm \begin{tikzpicture}[scale=.7] \tzhelplines[tzdashed=10/.7](4,3) %% \tzhelplines[step=.5,tzdotted=10/.7](4,3) %% \end{tikzpicture} \end{tzcode} %%------------------------------------------------------------ \section{\protect\cmd{\tzbbox}: A bounding box} \label{s:tzbbox} \icmd{\tzbbox} sets a bounding box. \begin{tzdef} % syntax \tzbbox()() % defaults (0,0)() % : mandatory \end{tzdef} \begin{tztikz} \tzbbox(-1,-1)(4,3) % is an abbreviation of: \path [ use as bounding box ] (-1,-1) rectangle (4,3); \end{tztikz} If only one coordinate is specified, the first coordinate is regarded as |(0,0)|. %%================================== \chapter{Dots} \label{c:dots} %%------------------------------------------------------------ \section{\protect\cmd{\tzcdot(*)}: A small circle} \label{s:tzcdot} A dot is usually expressed by a small circle. \icmd{\tzcdot} prints a circle dot \tikz \tzcdot(0,0);. The starred version \icmd{\tzcdot*} prints a filled circle dot \tikz \tzcdot*(0,0);. The \xem{radius} of the circle is |1.2pt|, by default. \begin{tzdef} % syntax: minimum \tzcdot() % syntax: medium \tzcdot*(){