diff options
Diffstat (limited to 'graphics/pgf/contrib/tzplot/tzplot-doc-E-v2.1.tex')
-rw-r--r-- | graphics/pgf/contrib/tzplot/tzplot-doc-E-v2.1.tex | 475 |
1 files changed, 475 insertions, 0 deletions
diff --git a/graphics/pgf/contrib/tzplot/tzplot-doc-E-v2.1.tex b/graphics/pgf/contrib/tzplot/tzplot-doc-E-v2.1.tex new file mode 100644 index 0000000000..7ae97f306b --- /dev/null +++ b/graphics/pgf/contrib/tzplot/tzplot-doc-E-v2.1.tex @@ -0,0 +1,475 @@ +%!TEX root = tzplot-doc.tex +%\begin{document} + +%%%%%===== PART: NOT YET!!! ============== +%%%%%%%%================================== +%%%%%\part{Miscellaneous Macros and Examples} +%%%%%%%%================================== +%%%%%\label{p:miscandexamples} +%%%%% +%%================================== + +%%================================== +\chapter{Miscellany} +\label{c:misc} + +%%------------------------------------------------------------ +\section{Middle arrows} +\label{s:midarrows} + +Four styles for middle arrow tips are predefined: |-->--|, |--o--|, |--x--| and |--/--|. + +\subsection{Controllable middle arrow tips: \texttt{-->--} and \protect\cmd{\settzmidarrow}} + +The middle arrow tip style \ixxw{-->--} prints a middle arrow tip of |stealth| by default. +It accepts one argument that changes the position (|0.5| by default) of a \iisw{middle arrow tip}, like |-->--=.75|. + + +\begin{tzcode}{.3} +\begin{tikzpicture} +% middle arrow tip: -->-- +\tzhelplines(4,3) +\tzline[-->--](0,3)(4,3) +\tzline[-->--=.75,blue,thick](0,2.5)(4,2.5) +\tzto[-->--,->,out=45](0,0)(4,1) +\end{tikzpicture} +\end{tzcode} + + +\paragraph{How to control middle arrow tips} +The default options for middle arrow tips are |-|, |thin|, |solid|, and |shorten >=0|, and |bend right=0|. The defaults can be changed by |\settzmidarrow|. + +The macro \icmd{\settzmidarrow} controls the position, style, and other options of middle arrow tips. The effect is valid until the end of the |tikzpicture| environment, unless changed again. + +\begin{tzdef} +% syntax: +\settzmidarrow<position>{<arrow tip style>}[<opt>] +% all arguments are optional +% defaults: + <0.5>{stealth}[-,thin,solid,shorten <=0,shorten >=0,bend right=0] +\end{tzdef} + + +\begin{tzcode}{.3} +% \settzmidarrow +\begin{tikzpicture} +\tzhelplines(4,3) +\settzmidarrow<.25>{Stealth[reversed]}[red,scale=2] % +\tzline[-->--](0,3)(4,3) +\tzline[-->--=.75,blue,thick](0,2.5)(4,2.5) +\tzto[-->--,->,out=45](0,0)(4,1) +\end{tikzpicture} +\end{tzcode} + + +\begin{tzcode}{.3} +% various arrow tip styles: arrows.meta +\begin{tikzpicture} +\tzhelplines(4,3) +\settzmidarrow{Circle[open]}[blue,scale=2] +\tzline[-->--](0,3)(4,3) +\tikzset{>=to} %% +\settzmidarrow{>>>}[blue,scale=2] +\tzline[-->--](0,2.5)(4,2.5) +\settzmidarrow<.25>{Rays}[blue,scale=2] +\tzline[-->--=.75,blue,thick](0,2)(4,2) +\tzto[-->--,->,red,out=45](0,0)(4,1) +\end{tikzpicture} +\end{tzcode} + +You can use various styles of arrow tips. (See \Tikz\ manual on |arrows.meta| library, for more details.) + + + +\subsection{Fixed middle arrow tip styles: \texttt{--o--}, \texttt{--x--}, \texttt{--/--}} + +Three styles for middle arrow tips are predefined: \xem{circle} |--o--| , \xem{cross} |--x--| , and \xem{diagonal} |--/--| middle arrow tips. +These middle arrow tip styles are fixed and cannot be changed. +|\settzmidarrow| can only be used with |[<opt>]| to control these middle arrow tips. +The other options |<position>| and |{<arrow tip style>}| options are ignored for these styles. + +\paragraph{Circle middle arrow tips:} + +The circle middle arrow tip style \ixxw{--o--} takes one argument to change the position (|0.5| by default). + +The circle is drawn like this: + +\begin{verbatim} + \draw [<opt>] (0,0) circle (1.2pt) ; +\end{verbatim} + +|\settzmidarrow| controls the circle arrow tip with |<opt>|. + +\begin{tzcode}{.3} +\begin{tikzpicture} +% circle middle arrow tip: --o-- +\tzhelplines(4,3) +\tzline[--o--](0,3)(4,3) +\tzline[--o--=.75,blue,thick](0,2.5)(4,2.5) +\tzto[--o--,->,out=45](0,0)(4,1) +\end{tikzpicture} +\end{tzcode} + +\begin{tzcode}{.3} +\begin{tikzpicture} +% \settzmidarrow: difference +\tzhelplines(4,3) +\settzmidarrow<.25>{Circle[open,fill=green]}[scale=2] % +\tzline[--o--,thick](0,3)(4,3) +\tzline[-->--=.5,blue,thick](0,2.5)(4,2.5) +\tzline[-->--,blue,thick](0,2)(4,2) +\settzmidarrow[scale=2,thick,fill=green] +\tzto[--o--=.25,->,out=45](0,0)(4,1) +\end{tikzpicture} +\end{tzcode} + + +\paragraph{Cross middle arrow tips:} + +The cross middle arrow tip style \ixxw{--x--} takes one argument to change the position (|0.5| by default). + +The cross mark is drawn like this: + +\begin{verbatim} + \draw [<opt>] (2pt,2pt) to (-2pt,-2pt) ; + \draw [<opt>] (-2pt,2pt) to (2pt,-2pt) ; +\end{verbatim} + +|\settzmidarrow| controls the cross arrow tip with |<opt>|. + +\begin{tzcode}{.3} +\begin{tikzpicture} +% cross middle arrow tip: --x-- +\tzhelplines(4,3) +\tzline[--x--](0,3)(4,3) +\tzline[--x--=.75,blue,thick](0,2.5)(4,2.5) +\tzto[--x--,->,out=45](0,0)(4,1) +\end{tikzpicture} +\end{tzcode} + +\begin{tzcode}{.3} +\begin{tikzpicture} +% \settzmidarrow: scale, tzextend +\tzhelplines(4,3) +\settzmidarrow<.25>{Rays[red]}[scale=2] % +\tzline[--x--,thick](0,3)(4,3) +\tzline[-->--=.5,blue,thick](0,2.5)(4,2.5) +\tzline[-->--,blue,thick](0,2)(4,2) +\settzmidarrow[thick,blue,tzextend={8pt}{8pt}] +\tzto[--x--=.25,->,out=45](0,0)(4,1) +\end{tikzpicture} +\end{tzcode} + + +\paragraph{Diagonal middle arrow tips} + +The diagonal middle arrow tip style \ixxw{--/--} takes one argument to change the position (|0.5| by default). + +The diagonal line is drawn like this: + +\begin{verbatim} + \draw [<opt>] (2pt,2pt) to (-2pt,-2pt) ; +\end{verbatim} + +|\settzmidarrow| controls the diagonal arrow tip line with |[<opt>]|. + +\begin{tzcode}{.3} +\begin{tikzpicture} +% diagonal middle arrow tip: --/-- +\tzhelplines(4,3) +\tzline[--/--](0,3)(4,3) +\tzline[--/--=.75,blue,thick](0,2.5)(4,2.5) +\tzto[--/--,->,out=45](0,0)(4,1) +\end{tikzpicture} +\end{tzcode} + +\begin{tzcode}{.3} +\begin{tikzpicture} +% \settzmidarrow: rotate, tzextend +\tzhelplines(4,3) +\tzline[--/--,thick](0,3)(4,3) +\tzline[--/--=.25,blue,thick](0,2.5)(4,2.5) +\settzmidarrow[rotate=90,red,tzextend={3pt}{3pt}] +\tzline[--/--,blue,thick](0,2)(4,2) +\tzto[--/--=.75,->,out=45](0,0)(4,1) +\end{tikzpicture} +\end{tzcode} + +\begin{tzcode}{.3} +\begin{tikzpicture} +% \settzmidarrow: bend left +\tzhelplines(4,3) +\settzmidarrow[scale=2,rotate=45,bend left=60] +\tzline[--/--,thick](0,3)(4,3) +\tzline[--/--=.25,blue,thick](0,2.5)(4,2.5) +\settzmidarrow[rotate=90,red,tzextend={3pt}{3pt}] +\tzline[--/--,blue,thick](0,2)(4,2) +\tzto[--/--=.75,->,out=45](0,0)(4,1) +\end{tikzpicture} +\end{tzcode} + + + +%%------------------------------------------------------------ +\section{\protect\cmd{\tzbrace(')}} +\label{s:tzbrace} + +\icmd{\tzbrace} takes two coordinates as mandatory arguments to draw a \xem{calligraphic brace} connecting them. + +\begin{tzdef} +% syntax: minimum +\tzbrace(<coor>)(<coor>) +% syntax: medium +\tzbrace(<coor>)(<coor>){<text>}[<node opt>] +% syntax: full +\tzbrace[<draw opt>]{<raise>}[<decoration opt>]<shift coor> + (<coor>)(<coor>){<text>}[<node opt>] +% defaults + []{5pt}[amplitude=5pt]<>(<m>)(<m>){}[] +\end{tzdef} + +The |raise| value of a brace is |5pt| by default and the value can be changed by the first curly brace optional argument |{<raise>}|. + +The |amplitude| of a brace is |5pt| by default. You can control the amplitude by writing the option |amplitude=<dim>| in the second bracket option |[<decoration opt>]|. + +\begin{tztikz} +\tzbrace[thick](0,0)(3,1) % works like: + \draw [thick,decorate,decoration={calligraphic brace, amplitude=5pt, raise=5pt}] + (0,0) to (3,1); +\end{tztikz} + +The \iisw{swap version} \icmd{\tzbrace'} swaps the coordinates. +So it prints a mirror image of |\tzbrace|. +For example, |\tzbrace'(0,0)(3,1)| is equivalent to |\tzbrace(3,1)(0,0)|. + +\begin{tzcode}{.3} +% \tzbrace(') +\begin{tikzpicture}[sloped] +\tzhelplines(4,2) +\tzline(0,0)(3,1) +\tzbrace(0,0)(3,1){AAA}[above=10pt,blue] +\tzbrace'[red](0,0)(3,1){BBB}[below=10pt] +\end{tikzpicture} +\end{tzcode} + +You can change the style of the decorating brace by the second bracket optional argument |[<decoration opt>]|. + +The color of the calligraphic brace can be changed by the option |pen colour| in the list of |[<draw option>]|. + +\begin{tzcode}{.3} +% \tzbrace('): decoration options +\begin{tikzpicture}[sloped] +\tzhelplines(4,3) +\tzline(0,0)(3,1) +\tzbrace [very thick,pen colour=blue] + [amplitude=10pt] + (0,0)(3,1){AAA}[a=15pt] +\tzbrace'[red,very thick]{10pt} + [brace,amplitude=10pt] + (0,0)(3,1){BBB}[b=20pt] +\end{tikzpicture} +\end{tzcode} + +You can also move a brace by specifying the option |<shift coor>| immediately before the the first mandatory coordinate. +The empty shift option |<>| is not allowed. + +\begin{tzcode}{.3} +% \tzbrace('): shift +\begin{tikzpicture}[sloped] +\tzhelplines(4,3) +\tzline(0,0)(3,1) +\tzbrace [very thick,pen colour=blue][amplitude=10pt] + <.5,.5>(0,0)(3,1){AAA}[a=15pt] +\tzbrace'[red,very thick]{10pt}[brace,amplitude=10pt] + (0,0)(3,1){BBB}[b=20pt] +\end{tikzpicture} +\end{tzcode} + + + + +%%------------------------------------------------------------ +\section{\protect\cmd{\tzsnake(+)}: Snake lines (Experimental)} +\label{s:tzsnake} + +\icmd{\tzsnake} connects two points with a snaked line, with many default values, using \Tikz's |to| operation. + +\begin{tztikz} +\tzsnake(0,1)(3,2) % works like + \draw [ decorate , decoration={ %% many defaults + snake, + segment length=5pt, % controlled by \tzsnake + amplitude=2.5pt, + pre length=5pt, + post length=5pt + } + ] (0,1) to (3,2) ; +\end{tztikz} + +\begin{tzcode}{.3} +\begin{tikzpicture} +\tzhelplines(4,3) +\tzsnake(0,1)(3,2) +\tzsnake[->,blue,bend right](1,0)(4,3) +\end{tikzpicture} +\end{tzcode} + +\begin{tzdef} +% syntax: minimum +\tzsnake(<coor>)(<coor>) +% syntax: full +\tzsnake[<opt>]{<segment length>}[<decoration opt>]<shift coor> + (<coor>){<text>}[<node opt>] + (<coor>){<text>}[<node opt>]<code.append> +% defaults + []{5pt}[many defaults above]<>(<m>){}[](<m>){}[]<> +\end{tzdef} + +The key |segment length| is controlled by the first curly brace option and you should write down all the other keys in the second bracket option |[<decoration opt>]| to change the values. Not specifying the option |{<segment length>}|, when the first bracket option is empty, you need empty brackets |[]|, like |\tzsnake[][<decoration opt>]...|. + +\begin{tzcode}{.3} +% \tzsnake: {segment length} option +\begin{tikzpicture} +\tzhelplines(4,3) +\tzsnake[blue]{3pt}[coil](0,1){spring}[a,sloped](3,2) +\tzsnake[->,bend right]{3pt} + [coil,amplitude=5pt,post length=20pt] + (1,0){coil line}[b,sloped](4,3){Up!}[draw,r] +\end{tikzpicture} +\end{tzcode} + +The plus version \icmd{\tzsnake+} uses the second mandatory coordinate as a relative coordinate to the first. Everything else is the same as in |\tzsnake|. + + +\begin{tzcode}{.3} +% \tzsnake(+): shift +\begin{tikzpicture} +\tzhelplines(4,3) +\tzsnake[->][post length=20pt](0,0)(3,0) +\tzsnake[->,red][post length=20pt]<1,1>(0,0)(3,0) %% +\tzsnake+[->,bend left,blue]{10pt}[post length=10pt] + (0,1){snake line}[a,sloped](4,2){what?}[r] +\end{tikzpicture} +\end{tzcode} + + +%%%%%%%% (under construction) +%%%%% +%%%%% +%%%%%%%------------------------------------------------------------ +%%%%%\section{\protect\cmd{\tzspy} (Experimental)} +%%%%%\label{s:tzspy} +%%%%% +%%%%% +%%%%%\begin{tzdef} +%%%%%% syntax: minimum +%%%%%\tzspy(<coor>)(<coor>) +%%%%%% syntax: full +%%%%%\tzbrace[<opt>]{<size>}[<maginificaltion>] +%%%%% (<on-coor>)(<in-coor>)[<node opt>]<code.append> +%%%%%% defaults +%%%%% [circle]{2cm}{5}(<m>)(<m>)[]<> +%%%%%\end{tzdef} +%%%%% +%%%%%To use |\tzspy| you need to tell \Tikz\ that a picture will be magnified, by specifying some special keys in the |tikzpicture| environment option, such as |spy using outlines|, |spy using overlays|, etc., as follows: +%%%%%\begin{verbatim} +%%%%% \begin{tikzpicture}[spy using outlines] +%%%%% <tzplot code> +%%%%% <tikz code> +%%%%% \tzspy... +%%%%% \end{tikzpicture} +%%%%%\end{verbatim} +%%%%% +%%%%%\begin{tzcode}[text above listing] +%%%%%\begin{tikzpicture}[scale=.1,font=\scriptsize,spy using outlines] +%%%%%\settzdotsize{1.2pt} +%%%%%\tzaxes(-15,0)(60,60){$Q$}{$P$} +%%%%% +%%%%%\def\Dem{50-\x} +%%%%%\def\Sup{.5*\x+5} +%%%%%\def\Supa{.5*\x+6.5} +%%%%% +%%%%%\tzfn{\Dem}[0:50]{$D$} +%%%%%\tzfn{\Sup}[-10:50]{$S$}[r] +%%%%%\tzfn{\Supa}[-10:50]{$S'$} +%%%%% +%%%%%\tzXpoint*{Dem}{Sup}(eqm) +%%%%%\tzXpoint*{Dem}{Supa}(eqma) +%%%%%\tzvXpointat*{Sup}{29}(eqmb) +%%%%% +%%%%%\tzproj[densely dotted](eqm){\rlap{300}}{200} +%%%%%\tzproj[densely dotted](eqma){\llap{290}}{\raisebox{1em}{210}} +%%%%%\tzprojy[densely dotted](eqmb){\raisebox{-2em}{195}} +%%%%% +%%%%%\tzticks{-10/-100,50/500}{5/50,50/500} +%%%%% +%%%%%\tzpath*[blue](eqm)(eqma)(eqmb); +%%%%% +%%%%%\tzspy($(eqma)!.5!(eqmb)$)(100,30) +%%%%% +%%%%%%\spy [blue,draw,circle,size=5cm, magnification = 5,connect spies] +%%%%%%on ($(eqma)!.5!(eqmb)$) in node at (100,30); +%%%%%\end{tikzpicture} +%%%%%\end{tzcode} +%%%%% +%%%%% +%%%%%\begin{tzcode}[text above listing] +%%%%%\begin{tikzpicture}[scale=.1,font=\scriptsize,spy using overlays] +%%%%%\settzdotsize{1.2pt} +%%%%%\tzaxes(-15,0)(60,60){$Q$}{$P$} +%%%%% +%%%%%\def\Dem{50-\x} +%%%%%\def\Sup{.5*\x+5} +%%%%%\def\Supa{.5*\x+6.5} +%%%%% +%%%%%\tzfn{\Dem}[0:50]{$D$} +%%%%%\tzfn{\Sup}[-10:50]{$S$}[r] +%%%%%\tzfn{\Supa}[-10:50]{$S'$} +%%%%% +%%%%%\tzXpoint*{Dem}{Sup}(eqm) +%%%%%\tzXpoint*{Dem}{Supa}(eqma) +%%%%%\tzvXpointat*{Sup}{29}(eqmb) +%%%%% +%%%%%\tzproj[densely dotted](eqm){\rlap{300}}{200} +%%%%%\tzproj[densely dotted](eqma){\llap{290}}{\raisebox{1em}{210}} +%%%%%\tzprojy[densely dotted](eqmb){\raisebox{-2em}{195}} +%%%%% +%%%%%\tzticks{-10/-100,50/500}{5/50,50/500} +%%%%% +%%%%%\tzpath*[blue](eqm)(eqma)(eqmb); +%%%%% +%%%%%\tzspy[connect spies]{5cm}[6]($(eqma)!.5!(eqmb)$)(100,30)[draw,fill=red,thick] +%%%%%\end{tikzpicture} +%%%%%\end{tzcode} +%%%%% + + + +%%%%%%%% (under construction) +%%%%%\section{\protect\cmd{\tzplotfile}: plotting data} +%%%%%\label{s:tzplotfile} +%%%%% +%%%%%\icmd{\tzplotfile} plots data. +%%%%% +%%%%%\begin{tcblisting}{listing only} +%%%%%% syntax +%%%%%\tzplotfile[<opt>]{<file name>}[<plot opt>] +%%%%%\end{tcblisting} +%%%%% +%%%%% +%%%%%\begin{tcblisting}{listing above text} +%%%%%\begin{tikzpicture} +%%%%%\tzplotfile{sine.data} +%%%%%\end{tikzpicture} +%%%%%\end{tcblisting} +%%%%% +%%%%%\begin{tcblisting}{listing above text} +%%%%%\begin{tikzpicture} +%%%%%\tzplotfile[blue]{sine.data}[mark=x] +%%%%%\end{tikzpicture} +%%%%%\end{tcblisting} + + + + + |