diff options
author | Karl Berry <karl@freefriends.org> | 2008-02-23 00:49:54 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-02-23 00:49:54 +0000 |
commit | 4fc1af1461e934c39f8f5e10d5d8788681d82223 (patch) | |
tree | 7716e8a3e8787a3d11c5ce728d21b808f786ce7d /Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex | |
parent | 6f5a4edf390b6e05291d7a4b816782b14122a205 (diff) |
tikz/pgf 2.0 first attempt (22feb08)
git-svn-id: svn://tug.org/texlive/trunk@6741 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex')
-rw-r--r-- | Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex | 124 |
1 files changed, 70 insertions, 54 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex index 043ba4c5312..b8fa8ed3588 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex @@ -193,16 +193,20 @@ braces, namely whenever you use an expression involving a paranthesis. The following options influence how the \meta{coordinate expression} is evaluated: -\begin{itemize} - \itemoption{variable}|=|\meta{macro} - sets the macro whose value is set to the different values when +\begin{key}{/tikz/variable=\meta{macro} (initially x)} + Sets the macro whose value is set to the different values when \meta{coordinate expression} is evaluated. - \itemoption{samples}|=|\meta{number} - sets the number of samples used in the plot. The default is 25. - \itemoption{domain}|=|\meta{start}|:|\meta{end} - sets the domain between which the samples are taken. The default is - |-5:5|. - \itemoption{samples at}|=|\meta{sample list} +\end{key} + +\begin{key}{/tikz/samples=\meta{number} (initially 25)} + Sets the number of samples used in the plot. +\end{key} + +\begin{key}{/tikz/domain=\meta{start}|:|\meta{end} (initially -5:5)} + Sets the domain between which the samples are taken. +\end{key} + +\begin{key}{/tikz/samples at=\meta{sample list}} This option specifies a list of positions for which the variable should be evaluated. For instance, you can say |samples at={1,2,8,9,10}| to have the variable evaluated exactly for @@ -212,7 +216,7 @@ is evaluated: When this option is used, the |samples| and |domain| option are overruled. The other ways round, setting either |samples| or |domain| will overrule this option. -\end{itemize} +\end{key} \begin{codeexample}[] \begin{tikzpicture}[domain=0:4] @@ -336,16 +340,12 @@ plots, use |t| as the variable for parametric plots. Here are some examples: \end{codeexample} -The following options influence the plot: +The plot in influenced by the following options: First, the options +|samples| and |domain| explained earlier. Second, there are some more +specialized options. -\begin{itemize} - \itemoption{samples}|=|\meta{number} - sets the number of samples used in the plot. The default is 25. - \itemoption{domain}|=|\meta{start}|:|\meta{end} - sets the domain between which the samples are taken. The default is - |-5:5|. - \itemoption{parametric}\opt{|=|\meta{true or false}} - sets whether the plot is a parametric plot. If true, then |t| must +\begin{key}{/tikz/parametric=\meta{boolena} (default true)} + Sets whether the plot is a parametric plot. If true, then |t| must be used instead of |x| as the parameter and two comma-separated functions must be given in the \meta{gnuplot formula}. An example is the following: @@ -353,20 +353,26 @@ The following options influence the plot: \tikz \draw[scale=0.5,domain=-3.141:3.141,smooth] plot[parametric,id=parametric-example] function{t*sin(t),t*cos(t)}; \end{codeexample} - - \itemoption{id}|=|\meta{id} - sets the identifier of the current plot. This should be a unique +\end{key} + +\begin{key}{/tikz/id=\meta{id}} + 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 \meta{id} will be part of a filename, so it should not contain anything fancy like |*| or |$|.%$ - \itemoption{prefix}|=|\meta{prefix} - is put before each plot file name. The default is |\jobname.|, but +\end{key} + +\begin{key}{/tikz/prefix=\meta{prefix}} + The \meta{prefix} is put before each plot file name. The default is + |\jobname.|, but if you have many plots, it might be better to use, say |plots/| and have all plots placed in a directory. You have to create the directory yourself. - \itemoption{raw gnuplot} - causes the \meta{gnuplot formula} to be passed on to +\end{key} + +\begin{key}{/tikz/raw gnuplot} + This key causes the \meta{gnuplot formula} to be passed on to \textsc{gnuplot} without setting up the samples or the |plot| operation. Thus, you could write \begin{codeexample}[code only] @@ -377,20 +383,19 @@ plot[raw gnuplot,id=raw-example] function{set samples 25; plot sin(x)} \textsc{gnuplot}. However, for really complicated situations you should create a special external generating \textsc{gnuplot} file and use the |file|-syntax to include the table ``by hand.'' -\end{itemize} +\end{key} The following styles influence the plot: -\begin{itemize} - \itemstyle{every plot} +\begin{stylekey}{/tikz/every plot (initially \normalfont empyt)} This style is installed in each plot, that is, as if you always said \begin{codeexample}[code only] - plot[style=every plot,...] + plot[every plot,...] \end{codeexample} This is most useful for globally setting a prefix for all plots by saying: \begin{codeexample}[code only] -\tikzstyle{every plot}=[prefix=plots/] +\tikzset{every plot/.style={prefix=plots/}} \end{codeexample} -\end{itemize} +\end{stylekey} @@ -403,8 +408,7 @@ placed \emph{after} the whole path has been drawn/filled/shaded. In this respect, they are handled like text nodes. In detail, the following options govern how marks are drawn: -\begin{itemize} - \itemoption{mark}|=|\meta{mark mnemonic} +\begin{key}{/tikz/mark=\meta{mark mnemonic}} Sets the mark to a mnemonic that has previously been defined using the |\pgfdeclareplotmark|. By default, |*|, |+|, and |x| are available, which draw a filled circle, a plus, and a cross as marks. Many more @@ -421,16 +425,18 @@ In detail, the following options govern how marks are drawn: Option & Effect \\\hline \vrule height14pt width0pt \plotmarkentrytikz{ball} \end{tabular} +\end{key} - \itemoption{mark repeat}|=|\meta{r} +\begin{key}{/tikz/mark repeat=\meta{r}} This option tells \tikzname\ that only every $r$th mark should be drawn. \begin{codeexample}[] \tikz \draw plot[mark=x,mark repeat=3,smooth] file {plots/pgfmanual-sine.table}; \end{codeexample} +\end{key} - \itemoption{mark phase}|=|\meta{p} +\begin{key}{/tikz/mark phase=\meta{p}} This option tells \tikzname\ that the first mark to be draw should be the $p$th, followed by the $(p+r)$th, then the $(p+2r)$th, and so on. @@ -438,8 +444,9 @@ In detail, the following options govern how marks are drawn: \begin{codeexample}[] \tikz \draw plot[mark=x,mark repeat=3,mark phase=6,smooth] file {plots/pgfmanual-sine.table}; \end{codeexample} +\end{key} - \itemoption{mark indices}|=|\meta{list} +\begin{key}{/tikz/mark indices=\meta{list}} This option allows you to specify explicitly the indices at which a mark should be placed. Counting starts with 1. You can use the |\foreach| syntax, that is, |...| can be used. @@ -448,8 +455,9 @@ In detail, the following options govern how marks are drawn: \tikz \draw plot[mark=x,mark indices={1,4,...,10,11,12,...,16,20},smooth] file {plots/pgfmanual-sine.table}; \end{codeexample} - - \itemoption{mark size}|=|\meta{dimension} +\end{key} + +\begin{key}{/tikz/mark size=\meta{dimension}} Sets the size of the plot marks. For circular plot marks, \meta{dimension} is the radius, for other plot marks \meta{dimension} should be about half the width and height. @@ -458,8 +466,9 @@ In detail, the following options govern how marks are drawn: effect by specifying |scale=|\meta{factor} as a local option, where \meta{factor} is the quotient of the desired size and the default size. However, using |mark size| is a bit faster and more natural. +\end{key} - \itemoption{mark options}|=|\meta{options} +\begin{key}{/tikz/mark options=\meta{options}} 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. @@ -468,7 +477,7 @@ In detail, the following options govern how marks are drawn: plot[mark=triangle*,mark options={color=blue,rotate=180}] file{plots/pgfmanual-sine.table} |- (0,0); \end{codeexample} -\end{itemize} +\end{key} @@ -479,13 +488,13 @@ 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 |plot|. -\begin{itemize} - \itemoption{sharp plot} +\begin{key}{/tikz/sharp plot} 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, |smooth|. - - \itemoption{smooth} +\end{key} + +\begin{key}{/tikz/smooth} This option causes the points on the path to be connected using a smooth curve: @@ -497,8 +506,9 @@ use options to change the behavior of |plot|. get the best results if the bending angles are small, that is, less than about $30^\circ$ and, even more importantly, if the distances between points are about the same all over the plotting path. +\end{key} - \itemoption{tension}|=|\meta{value} +\begin{key}{/tikz/tension=\meta{value}} 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 @@ -515,8 +525,9 @@ use options to change the behavior of |plot|. coordinates{(0,0) (1,1) (2,0) (1,-1)}; \end{tikzpicture} \end{codeexample} - - \itemoption{smooth cycle} +\end{key} + +\begin{key}{/tikz/smooth cycle} This option causes the points on the path to be connected using a closed smooth curve. @@ -525,8 +536,9 @@ use options to change the behavior of |plot|. \draw plot[smooth cycle] coordinates{(0,0) (1,0) (2,1) (1,2)} plot coordinates{(0,0) (1,0) (2,1) (1,2)} -- cycle; \end{codeexample} +\end{key} - \itemoption{ycomb} +\begin{key}{/tikz/ycomb} This option causes the |plot| 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 $x$-axis to the point, @@ -544,15 +556,19 @@ use options to change the behavior of |plot|. plot coordinates{(0,1.2) (.5,1.3) (1,.5) (1.5,.2) (2,.5)}; \end{tikzpicture} \end{codeexample} +\end{key} + - \itemoption{xcomb} +\begin{key}{/tikz/xcomb} This option works like |ycomb| except that the bars are horizontal. \begin{codeexample}[] \tikz \draw plot[xcomb,mark=x] coordinates{(1,0) (0.8,0.2) (0.6,0.4) (0.2,1)}; \end{codeexample} +\end{key} - \itemoption{polar comb} + +\begin{key}{/tikz/polar comb} This option causes a line from the origin to the point to be added to the path for each plot point. @@ -561,9 +577,10 @@ use options to change the behavior of |plot|. mark=pentagon*,mark options={fill=white,draw=red},mark size=4pt] coordinates {(0:1cm) (30:1.5cm) (160:.5cm) (250:2cm) (-60:.8cm)}; \end{codeexample} +\end{key} - \itemoption{only marks} +\begin{key}{/tikz/only marks} 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. @@ -572,6 +589,5 @@ use options to change the behavior of |plot|. \tikz \draw (0,0) sin (1,1) cos (2,0) plot[only marks,mark=x] coordinates{(0,0) (1,1) (2,0) (3,-1)}; \end{codeexample} -\end{itemize} - +\end{key} |