summaryrefslogtreecommitdiff
path: root/graphics/pgf/base/doc/text-en/pgfmanual-en-dv-stylesheets.tex
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/base/doc/text-en/pgfmanual-en-dv-stylesheets.tex')
-rw-r--r--graphics/pgf/base/doc/text-en/pgfmanual-en-dv-stylesheets.tex1735
1 files changed, 1645 insertions, 90 deletions
diff --git a/graphics/pgf/base/doc/text-en/pgfmanual-en-dv-stylesheets.tex b/graphics/pgf/base/doc/text-en/pgfmanual-en-dv-stylesheets.tex
index 0e162cc1c3..526992cf0f 100644
--- a/graphics/pgf/base/doc/text-en/pgfmanual-en-dv-stylesheets.tex
+++ b/graphics/pgf/base/doc/text-en/pgfmanual-en-dv-stylesheets.tex
@@ -71,7 +71,7 @@ to this attribute is that each visualizer is styled differently.
For the following examples, let us first define a simple data set:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{datavisualization.formats.functions}}]
\tikz \datavisualization data group {function classes} = {
data [set=log, format=function] {
var x : interval [0.2:2.5];
@@ -92,7 +92,27 @@ For the following examples, let us first define a simple data set:
};
\end{codeexample}
-\begin{codeexample}[width=6cm]
+\begin{codeexample}[
+ width=6cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};}]
\tikz \datavisualization [
school book axes, all axes={unit length=7.5mm},
visualize as smooth line/.list={log, lin, squared, exp},
@@ -100,7 +120,27 @@ For the following examples, let us first define a simple data set:
data group {function classes};
\end{codeexample}
-\begin{codeexample}[width=6cm]
+\begin{codeexample}[
+ width=6cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};}]
\tikz \datavisualization [
school book axes, all axes={unit length=7.5mm},
visualize as smooth line/.list={log, lin, squared, exp},
@@ -129,7 +169,27 @@ high-quality legends. Additionally, it also offers ways of easily adding labels
for visualizers directly inside the data visualization, which is even better
than adding a legend, in general.
%
-\begin{codeexample}[width=7cm]
+\begin{codeexample}[
+ width=7cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};}]
\tikz \datavisualization [
school book axes, all axes={unit length=7.5mm},
x axis={label=$x$},
@@ -142,7 +202,27 @@ than adding a legend, in general.
data group {function classes};
\end{codeexample}
-\begin{codeexample}[width=6.3cm]
+\begin{codeexample}[
+ width=6.3cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};}]
\tikz \datavisualization [
school book axes,
x axis={label=$x$},
@@ -176,7 +256,28 @@ there is a special, easy-to-remember option for this:
Adds the \meta{style sheet} to the list of style sheets attached to the
|set| attribute.
%
-\begin{codeexample}[width=6cm]
+\begin{codeexample}[
+ width=6cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
school book axes, all axes={unit length=7.5mm},
visualize as smooth line/.list={log, lin, squared, exp},
@@ -281,7 +382,7 @@ this restriction in a minute).
We would now write:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{datavisualization}}]
\pgfkeys{
/pgf/data visualization/style sheets/traffic light/.cd,
% All these styles have the above prefix.
@@ -321,7 +422,17 @@ look at an example:
3/.style={red!80!black},
default style/.style={black}
}
-\begin{codeexample}[]
+\begin{codeexample}[
+ preamble={\usetikzlibrary{datavisualization}},
+ pre={\pgfkeys{
+ /pgf/data visualization/style sheets/traffic light/.cd,
+ % All these styles have the above prefix.
+ 1/.style={green!50!black},
+ 2/.style={yellow!90!black},
+ 3/.style={red!80!black},
+ default style/.style={black}
+}},
+]
% Definition of traffic light keys as above
\begin{tikzpicture}
\datavisualization data group {lines} = {
@@ -354,7 +465,25 @@ with |/data point| are inserted automatically for you, so they can be left out.
However, you would need them for instance when you would like several different
data sets to use the same styling:
%
-\begin{codeexample}[]
+\begin{codeexample}[
+ preamble={\usetikzlibrary{datavisualization}},
+ pre={\pgfkeys{
+ /pgf/data visualization/style sheets/traffic light/.cd,
+ % All these styles have the above prefix.
+ 1/.style={green!50!black},
+ 2/.style={yellow!90!black},
+ 3/.style={red!80!black},
+ default style/.style={black}
+}%
+\tikz \datavisualization data group {lines} = {
+ data point [x=0, y=0, set=normal]
+ data point [x=2, y=2, set=normal]
+ data point [x=0, y=1, set=heated]
+ data point [x=2, y=1, set=heated]
+ data point [x=0.5, y=1.5, set=critical]
+ data point [x=2.25, y=1.75, set=critical]
+};},
+]
% Definition of traffic light keys as above
\tikz \datavisualization [
school book axes,
@@ -389,7 +518,17 @@ pattern according to the value of the attribute. We do not need to define an
large number of styles in this case, but can use the |default style| key to
``calculate'' the correct dashing.
-\begin{codeexample}[]
+\begin{codeexample}[
+ preamble={\usetikzlibrary{datavisualization}},
+ pre={\tikz \datavisualization data group {lines} = {
+ data point [x=0, y=0, set=normal]
+ data point [x=2, y=2, set=normal]
+ data point [x=0, y=1, set=heated]
+ data point [x=2, y=1, set=heated]
+ data point [x=0.5, y=1.5, set=critical]
+ data point [x=2.25, y=1.75, set=critical]
+};},
+]
\pgfdvdeclarestylesheet{my dashings}{
default style/.style={dash pattern={on #1pt off 1pt}}
}
@@ -418,7 +557,17 @@ the color:
color is simply that it makes many internals of the data visualization
engine a bit simpler.
%
-\begin{codeexample}[]
+\begin{codeexample}[
+ preamble={\usetikzlibrary{datavisualization}},
+ pre={\tikz \datavisualization data group {lines} = {
+ data point [x=0, y=0, set=normal]
+ data point [x=2, y=2, set=normal]
+ data point [x=0, y=1, set=heated]
+ data point [x=2, y=1, set=heated]
+ data point [x=0.5, y=1.5, set=critical]
+ data point [x=2.25, y=1.75, set=critical]
+};},
+]
\pgfdvdeclarestylesheet{my colors}
{
default style/.style={visualizer color=black},
@@ -452,7 +601,17 @@ documentation of the |xcolor| package for details.
series is used (since counting starts at |0| for color series). Thus, in
general, you need to start the \meta{initial color} ``one early''.
%
-\begin{codeexample}[]
+\begin{codeexample}[
+ preamble={\usetikzlibrary{datavisualization}},
+ pre={\tikz \datavisualization data group {lines} = {
+ data point [x=0, y=0, set=normal]
+ data point [x=2, y=2, set=normal]
+ data point [x=0, y=1, set=heated]
+ data point [x=2, y=1, set=heated]
+ data point [x=0.5, y=1.5, set=critical]
+ data point [x=2.25, y=1.75, set=critical]
+};},
+]
\tikzdvdeclarestylesheetcolorseries{greens}{hsb}{0.3,1.3,0.8}{0,-.4,-.1}
\tikz \datavisualization [
school book axes,
@@ -533,7 +692,35 @@ data set are used:
are only two or three lines, and even then it is not particularly pleasing
visually.
%
-\begin{codeexample}[width=10cm]
+\begin{codeexample}[
+ width=10cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ example visualization/.style={
+ scientific axes=clean,
+ y axis={ticks={style={
+ /pgf/number format/fixed,
+ /pgf/number format/fixed zerofill,
+ /pgf/number format/precision=2}}},
+ x axis={ticks={tick suffix=${}^\circ$}},
+ 1={label in legend={text=$\frac{1}{6}\sin 11x$}},
+ 2={label in legend={text=$\frac{1}{7}\sin 12x$}},
+ 3={label in legend={text=$\frac{1}{8}\sin 13x$}},
+ 4={label in legend={text=$\frac{1}{9}\sin 14x$}},
+ 5={label in legend={text=$\frac{1}{10}\sin 15x$}},
+ 6={label in legend={text=$\frac{1}{11}\sin 16x$}},
+ 7={label in legend={text=$\frac{1}{12}\sin 17x$}},
+ 8={label in legend={text=$\frac{1}{13}\sin 18x$}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list=
{1,2,3,4,5,6,7,8},
@@ -551,7 +738,35 @@ data group {sin functions};
often the best choice when the visualization is to be printed in black and
white.
%
-\begin{codeexample}[width=10cm]
+\begin{codeexample}[
+ width=10cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ example visualization/.style={
+ scientific axes=clean,
+ y axis={ticks={style={
+ /pgf/number format/fixed,
+ /pgf/number format/fixed zerofill,
+ /pgf/number format/precision=2}}},
+ x axis={ticks={tick suffix=${}^\circ$}},
+ 1={label in legend={text=$\frac{1}{6}\sin 11x$}},
+ 2={label in legend={text=$\frac{1}{7}\sin 12x$}},
+ 3={label in legend={text=$\frac{1}{8}\sin 13x$}},
+ 4={label in legend={text=$\frac{1}{9}\sin 14x$}},
+ 5={label in legend={text=$\frac{1}{10}\sin 15x$}},
+ 6={label in legend={text=$\frac{1}{11}\sin 16x$}},
+ 7={label in legend={text=$\frac{1}{12}\sin 17x$}},
+ 8={label in legend={text=$\frac{1}{13}\sin 18x$}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list=
{1,2,3,4,5,6,7,8},
@@ -575,7 +790,35 @@ data group {sin functions};
visualizations when many different lines (ten or more) should be printed in
black and white.
%
-\begin{codeexample}[width=10cm]
+\begin{codeexample}[
+ width=10cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ example visualization/.style={
+ scientific axes=clean,
+ y axis={ticks={style={
+ /pgf/number format/fixed,
+ /pgf/number format/fixed zerofill,
+ /pgf/number format/precision=2}}},
+ x axis={ticks={tick suffix=${}^\circ$}},
+ 1={label in legend={text=$\frac{1}{6}\sin 11x$}},
+ 2={label in legend={text=$\frac{1}{7}\sin 12x$}},
+ 3={label in legend={text=$\frac{1}{8}\sin 13x$}},
+ 4={label in legend={text=$\frac{1}{9}\sin 14x$}},
+ 5={label in legend={text=$\frac{1}{10}\sin 15x$}},
+ 6={label in legend={text=$\frac{1}{11}\sin 16x$}},
+ 7={label in legend={text=$\frac{1}{12}\sin 17x$}},
+ 8={label in legend={text=$\frac{1}{13}\sin 18x$}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list=
{1,2,3,4,5,6,7,8},
@@ -588,7 +831,35 @@ data group {sin functions};
For comparison, here is the must-less-than-satisfactory result of combining
the two independent style sheets:
%
-\begin{codeexample}[width=10cm]
+\begin{codeexample}[
+ width=10cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ example visualization/.style={
+ scientific axes=clean,
+ y axis={ticks={style={
+ /pgf/number format/fixed,
+ /pgf/number format/fixed zerofill,
+ /pgf/number format/precision=2}}},
+ x axis={ticks={tick suffix=${}^\circ$}},
+ 1={label in legend={text=$\frac{1}{6}\sin 11x$}},
+ 2={label in legend={text=$\frac{1}{7}\sin 12x$}},
+ 3={label in legend={text=$\frac{1}{8}\sin 13x$}},
+ 4={label in legend={text=$\frac{1}{9}\sin 14x$}},
+ 5={label in legend={text=$\frac{1}{10}\sin 15x$}},
+ 6={label in legend={text=$\frac{1}{11}\sin 16x$}},
+ 7={label in legend={text=$\frac{1}{12}\sin 17x$}},
+ 8={label in legend={text=$\frac{1}{13}\sin 18x$}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list=
{1,2,3,4,5,6,7,8},
@@ -616,7 +887,35 @@ lines. In the latter case, the marks are added to the lines.
This style supports only up to six different data sets and requires the
|plotmarks| library.
%
-\begin{codeexample}[width=10cm]
+\begin{codeexample}[
+ width=10cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ example visualization/.style={
+ scientific axes=clean,
+ y axis={ticks={style={
+ /pgf/number format/fixed,
+ /pgf/number format/fixed zerofill,
+ /pgf/number format/precision=2}}},
+ x axis={ticks={tick suffix=${}^\circ$}},
+ 1={label in legend={text=$\frac{1}{6}\sin 11x$}},
+ 2={label in legend={text=$\frac{1}{7}\sin 12x$}},
+ 3={label in legend={text=$\frac{1}{8}\sin 13x$}},
+ 4={label in legend={text=$\frac{1}{9}\sin 14x$}},
+ 5={label in legend={text=$\frac{1}{10}\sin 15x$}},
+ 6={label in legend={text=$\frac{1}{11}\sin 16x$}},
+ 7={label in legend={text=$\frac{1}{12}\sin 17x$}},
+ 8={label in legend={text=$\frac{1}{13}\sin 18x$}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as scatter/.list=
{1,2,3,4,5,6,7,8},
@@ -625,7 +924,35 @@ lines. In the latter case, the marks are added to the lines.
data group {sin functions};
\end{codeexample}
%
-\begin{codeexample}[width=10cm]
+\begin{codeexample}[
+ width=10cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ example visualization/.style={
+ scientific axes=clean,
+ y axis={ticks={style={
+ /pgf/number format/fixed,
+ /pgf/number format/fixed zerofill,
+ /pgf/number format/precision=2}}},
+ x axis={ticks={tick suffix=${}^\circ$}},
+ 1={label in legend={text=$\frac{1}{6}\sin 11x$}},
+ 2={label in legend={text=$\frac{1}{7}\sin 12x$}},
+ 3={label in legend={text=$\frac{1}{8}\sin 13x$}},
+ 4={label in legend={text=$\frac{1}{9}\sin 14x$}},
+ 5={label in legend={text=$\frac{1}{10}\sin 15x$}},
+ 6={label in legend={text=$\frac{1}{11}\sin 16x$}},
+ 7={label in legend={text=$\frac{1}{12}\sin 17x$}},
+ 8={label in legend={text=$\frac{1}{13}\sin 18x$}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list=
{1,2,3,4,5,6,7,8},
@@ -663,7 +990,35 @@ situations.
sheet, the visualizations are easier to read when this style sheet is used.
Up to six different data sets are supported.
%
-\begin{codeexample}[width=10cm]
+\begin{codeexample}[
+ width=10cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ example visualization/.style={
+ scientific axes=clean,
+ y axis={ticks={style={
+ /pgf/number format/fixed,
+ /pgf/number format/fixed zerofill,
+ /pgf/number format/precision=2}}},
+ x axis={ticks={tick suffix=${}^\circ$}},
+ 1={label in legend={text=$\frac{1}{6}\sin 11x$}},
+ 2={label in legend={text=$\frac{1}{7}\sin 12x$}},
+ 3={label in legend={text=$\frac{1}{8}\sin 13x$}},
+ 4={label in legend={text=$\frac{1}{9}\sin 14x$}},
+ 5={label in legend={text=$\frac{1}{10}\sin 15x$}},
+ 6={label in legend={text=$\frac{1}{11}\sin 16x$}},
+ 7={label in legend={text=$\frac{1}{12}\sin 17x$}},
+ 8={label in legend={text=$\frac{1}{13}\sin 18x$}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list=
{1,2,3,4,5,6,7,8},
@@ -672,7 +1027,35 @@ situations.
data group {sin functions};
\end{codeexample}
%
-\begin{codeexample}[width=10cm]
+\begin{codeexample}[
+ width=10cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ example visualization/.style={
+ scientific axes=clean,
+ y axis={ticks={style={
+ /pgf/number format/fixed,
+ /pgf/number format/fixed zerofill,
+ /pgf/number format/precision=2}}},
+ x axis={ticks={tick suffix=${}^\circ$}},
+ 1={label in legend={text=$\frac{1}{6}\sin 11x$}},
+ 2={label in legend={text=$\frac{1}{7}\sin 12x$}},
+ 3={label in legend={text=$\frac{1}{8}\sin 13x$}},
+ 4={label in legend={text=$\frac{1}{9}\sin 14x$}},
+ 5={label in legend={text=$\frac{1}{10}\sin 15x$}},
+ 6={label in legend={text=$\frac{1}{11}\sin 16x$}},
+ 7={label in legend={text=$\frac{1}{12}\sin 17x$}},
+ 8={label in legend={text=$\frac{1}{13}\sin 18x$}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list=
{1,2,3,4,5,6,7,8},
@@ -692,7 +1075,35 @@ data sets lead to nearly indistinguishable data sets.
\begin{stylesheet}{vary hue}
This style uses a different hue for each data set.
%
-\begin{codeexample}[width=10cm]
+\begin{codeexample}[
+ width=10cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ example visualization/.style={
+ scientific axes=clean,
+ y axis={ticks={style={
+ /pgf/number format/fixed,
+ /pgf/number format/fixed zerofill,
+ /pgf/number format/precision=2}}},
+ x axis={ticks={tick suffix=${}^\circ$}},
+ 1={label in legend={text=$\frac{1}{6}\sin 11x$}},
+ 2={label in legend={text=$\frac{1}{7}\sin 12x$}},
+ 3={label in legend={text=$\frac{1}{8}\sin 13x$}},
+ 4={label in legend={text=$\frac{1}{9}\sin 14x$}},
+ 5={label in legend={text=$\frac{1}{10}\sin 15x$}},
+ 6={label in legend={text=$\frac{1}{11}\sin 16x$}},
+ 7={label in legend={text=$\frac{1}{12}\sin 17x$}},
+ 8={label in legend={text=$\frac{1}{13}\sin 18x$}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list=
{1,2,3,4,5,6,7,8},
@@ -706,7 +1117,35 @@ data group {sin functions};
\begin{stylesheet}{shades of blue}
As the name suggests, different shades of blue are used for different data
sets.
-\begin{codeexample}[width=10cm]
+\begin{codeexample}[
+ width=10cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ example visualization/.style={
+ scientific axes=clean,
+ y axis={ticks={style={
+ /pgf/number format/fixed,
+ /pgf/number format/fixed zerofill,
+ /pgf/number format/precision=2}}},
+ x axis={ticks={tick suffix=${}^\circ$}},
+ 1={label in legend={text=$\frac{1}{6}\sin 11x$}},
+ 2={label in legend={text=$\frac{1}{7}\sin 12x$}},
+ 3={label in legend={text=$\frac{1}{8}\sin 13x$}},
+ 4={label in legend={text=$\frac{1}{9}\sin 14x$}},
+ 5={label in legend={text=$\frac{1}{10}\sin 15x$}},
+ 6={label in legend={text=$\frac{1}{11}\sin 16x$}},
+ 7={label in legend={text=$\frac{1}{12}\sin 17x$}},
+ 8={label in legend={text=$\frac{1}{13}\sin 18x$}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list=
{1,2,3,4,5,6,7,8},
@@ -718,7 +1157,35 @@ data group {sin functions};
\end{stylesheet}
\begin{stylesheet}{shades of red}
-\begin{codeexample}[width=10cm]
+\begin{codeexample}[
+ width=10cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ example visualization/.style={
+ scientific axes=clean,
+ y axis={ticks={style={
+ /pgf/number format/fixed,
+ /pgf/number format/fixed zerofill,
+ /pgf/number format/precision=2}}},
+ x axis={ticks={tick suffix=${}^\circ$}},
+ 1={label in legend={text=$\frac{1}{6}\sin 11x$}},
+ 2={label in legend={text=$\frac{1}{7}\sin 12x$}},
+ 3={label in legend={text=$\frac{1}{8}\sin 13x$}},
+ 4={label in legend={text=$\frac{1}{9}\sin 14x$}},
+ 5={label in legend={text=$\frac{1}{10}\sin 15x$}},
+ 6={label in legend={text=$\frac{1}{11}\sin 16x$}},
+ 7={label in legend={text=$\frac{1}{12}\sin 17x$}},
+ 8={label in legend={text=$\frac{1}{13}\sin 18x$}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list=
{1,2,3,4,5,6,7,8},
@@ -732,7 +1199,35 @@ data group {sin functions};
For once, this style sheet can also be used when the visualization is
printed in black and white.
%
-\begin{codeexample}[width=10cm]
+\begin{codeexample}[
+ width=10cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ example visualization/.style={
+ scientific axes=clean,
+ y axis={ticks={style={
+ /pgf/number format/fixed,
+ /pgf/number format/fixed zerofill,
+ /pgf/number format/precision=2}}},
+ x axis={ticks={tick suffix=${}^\circ$}},
+ 1={label in legend={text=$\frac{1}{6}\sin 11x$}},
+ 2={label in legend={text=$\frac{1}{7}\sin 12x$}},
+ 3={label in legend={text=$\frac{1}{8}\sin 13x$}},
+ 4={label in legend={text=$\frac{1}{9}\sin 14x$}},
+ 5={label in legend={text=$\frac{1}{10}\sin 15x$}},
+ 6={label in legend={text=$\frac{1}{11}\sin 16x$}},
+ 7={label in legend={text=$\frac{1}{12}\sin 17x$}},
+ 8={label in legend={text=$\frac{1}{13}\sin 18x$}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list=
{1,2,3,4,5,6,7,8},
@@ -822,7 +1317,28 @@ data set:
point where the \meta{attribute} is at least \meta{number} (if this
never happens, the last data point is used).
%
-\begin{codeexample}[width=6.3cm]
+\begin{codeexample}[
+ width=6.3cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
school book axes,
x axis={label=$x$},
@@ -842,7 +1358,28 @@ data group {function classes};
This key chooses the \meta{number}th data point belonging to the
visualizer's data set.
%
-\begin{codeexample}[width=6.3cm]
+\begin{codeexample}[
+ width=6.3cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
school book axes,
x axis={label=$x$},
@@ -861,7 +1398,28 @@ data group {function classes};
index is at least \meta{fraction} times the number of all data points
in the data set.
%
-\begin{codeexample}[width=6.3cm]
+\begin{codeexample}[
+ width=6.3cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
school book axes,
x axis={label=$x$},
@@ -887,7 +1445,10 @@ data group {function classes};
will be placed at different positions along the lines with hopefully
only little overlap.
%
-\begin{codeexample}[width=6.3cm]
+\begin{codeexample}[
+ width=6.3cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+]
\tikz \datavisualization [
scientific axes=clean,
visualize as smooth line/.list={linear, squared, cubed},
@@ -930,7 +1491,28 @@ data [set=cubed, format=function] {
This style has a default definition, usually you should just append
things to this style.
%
-\begin{codeexample}[width=6.3cm]
+\begin{codeexample}[
+ width=6.3cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
school book axes,
x axis={label=$x$},
@@ -964,7 +1546,10 @@ data group {function classes};
to it via a small line (this is like the difference between the |label| and
|pin| options).
%
-\begin{codeexample}[width=6.3cm]
+\begin{codeexample}[
+ width=6.3cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+]
\tikz \datavisualization [
scientific axes=clean,
visualize as smooth line/.list={linear, squared, cubed},
@@ -1009,7 +1594,28 @@ data [set=cubed, format=function] {
See the description of |pin angle|.
\end{key}
%
-\begin{codeexample}[width=6.3cm]
+\begin{codeexample}[
+ width=6.3cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
school book axes,
x axis={label=$x$},
@@ -1090,7 +1696,28 @@ usually use the |legend| key instead, see below):
Adds the \meta{options} to the list of options that will be executed
when the legend's node is created.
%
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
visualize as smooth line/.list=
@@ -1115,7 +1742,28 @@ data group {function classes};
the right of the data set visualization.
\end{stylekey}
%
-\begin{codeexample}[width=6cm]
+\begin{codeexample}[
+ width=6cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes, x axis={label=$x$},
visualize as smooth line/.list={log, lin, squared, exp},
@@ -1139,7 +1787,28 @@ data group {function classes};
key creates a new |main legend| and immediately passes the configuration
\meta{options} to this legend.
%
-\begin{codeexample}[width=7cm]
+\begin{codeexample}[
+ width=7cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes, x axis={label=$x$},
visualize as smooth line/.list={log, lin, squared, exp},
@@ -1192,7 +1861,28 @@ the key |label in legend| must be used together with a data set:
Use this key to setup the \meta{text} that is shown as the label of the
data set.
%
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes, x axis={label=$x$},
visualize as smooth line/.list=
@@ -1256,7 +1946,30 @@ configure which strategy is used using the following keys:
once a column is full, the next column is begun to the right of the
previous one. This is the default.
%
-\begin{codeexample}[width=6cm]
+\begin{codeexample}[
+ width=6cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1285,7 +1998,30 @@ data group {sin functions};
\end{key}
\begin{key}{/tikz/data visualization/legend options/down then left}
-\begin{codeexample}[width=6cm]
+\begin{codeexample}[
+ width=6cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1295,7 +2031,30 @@ data group {sin functions};
\end{key}
\begin{key}{/tikz/data visualization/legend options/up then right}
-\begin{codeexample}[width=6cm]
+\begin{codeexample}[
+ width=6cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1305,7 +2064,30 @@ data group {sin functions};
\end{key}
\begin{key}{/tikz/data visualization/legend options/up then left}
-\begin{codeexample}[width=6cm]
+\begin{codeexample}[
+ width=6cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1315,7 +2097,30 @@ data group {sin functions};
\end{key}
\begin{key}{/tikz/data visualization/legend options/left then up}
-\begin{codeexample}[width=6cm]
+\begin{codeexample}[
+ width=6cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1325,7 +2130,30 @@ data group {sin functions};
\end{key}
\begin{key}{/tikz/data visualization/legend options/left then down}
-\begin{codeexample}[width=6cm]
+\begin{codeexample}[
+ width=6cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1335,7 +2163,30 @@ data group {sin functions};
\end{key}
\begin{key}{/tikz/data visualization/legend options/right then up}
-\begin{codeexample}[width=6cm]
+\begin{codeexample}[
+ width=6cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1345,7 +2196,30 @@ data group {sin functions};
\end{key}
\begin{key}{/tikz/data visualization/legend options/right then down}
-\begin{codeexample}[width=6cm]
+\begin{codeexample}[
+ width=6cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1365,7 +2239,30 @@ begun. This is achieved using the following keys:
As the legend matrix is being filled, whenever the number of rows in the
current column would exceed \meta{number}, a new column is started.
%
-\begin{codeexample}[width=7cm]
+\begin{codeexample}[
+ width=7cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1373,7 +2270,30 @@ begun. This is achieved using the following keys:
data group {sin functions};
\end{codeexample}
%
-\begin{codeexample}[width=7cm]
+\begin{codeexample}[
+ width=7cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1381,7 +2301,30 @@ data group {sin functions};
data group {sin functions};
\end{codeexample}
%
-\begin{codeexample}[width=7cm]
+\begin{codeexample}[
+ width=7cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1397,7 +2340,30 @@ data group {sin functions};
you use this key with a strategy that first goes left or right and then up
or down.
%
-\begin{codeexample}[width=7cm]
+\begin{codeexample}[
+ width=7cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1405,7 +2371,30 @@ data group {sin functions};
data group {sin functions};
\end{codeexample}
%
-\begin{codeexample}[width=7cm]
+\begin{codeexample}[
+ width=7cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1413,7 +2402,30 @@ data group {sin functions};
data group {sin functions};
\end{codeexample}
%
-\begin{codeexample}[width=7cm]
+\begin{codeexample}[
+ width=7cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1441,7 +2453,30 @@ value.
|max rows| value of rows per column, more columns than the ideal number are
created.
%
-\begin{codeexample}[width=7cm]
+\begin{codeexample}[
+ width=7cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1449,7 +2484,30 @@ value.
data group {sin functions};
\end{codeexample}
%
-\begin{codeexample}[width=7cm]
+\begin{codeexample}[
+ width=7cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1457,7 +2515,30 @@ data group {sin functions};
data group {sin functions};
\end{codeexample}
%
-\begin{codeexample}[width=7cm]
+\begin{codeexample}[
+ width=7cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1474,7 +2555,30 @@ data group {sin functions};
\begin{key}{/tikz/data visualization/legend options/ideal number of rows=\meta{number}}
Works like |ideal number of columns|.
%
-\begin{codeexample}[width=7cm]
+\begin{codeexample}[
+ width=7cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1482,7 +2586,30 @@ data group {sin functions};
data group {sin functions};
\end{codeexample}
%
-\begin{codeexample}[width=7cm]
+\begin{codeexample}[
+ width=7cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1490,7 +2617,30 @@ data group {sin functions};
data group {sin functions};
\end{codeexample}
%
-\begin{codeexample}[width=7cm]
+\begin{codeexample}[
+ width=7cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {sin functions} = {
+ data [format=function] {
+ var set : {1,...,8};
+ var x : interval [0:50];
+ func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
+ }
+};%
+\tikzdatavisualizationset {
+ legend example/.style={
+ scientific axes, all axes={length=1cm, ticks=none},
+ 1={label in legend={text=1}},
+ 2={label in legend={text=2}},
+ 3={label in legend={text=3}},
+ 4={label in legend={text=4}},
+ 5={label in legend={text=5}},
+ 6={label in legend={text=6}},
+ 7={label in legend={text=7}},
+ 8={label in legend={text=8}}
+ }
+}},
+]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
@@ -1540,7 +2690,28 @@ but these options internally just map to the following two options:
As an example, let us put a legend to the right of the visualization, but
so that the first entry starts at the top of the visualization:
%
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes, x axis={label=$x$},
visualize as smooth line/.list=
@@ -1569,7 +2740,28 @@ visualization.
\begin{key}{/tikz/data visualization/legend options/east outside}
Placing the legend to the right of the data visualization is the default:
%
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
visualize as smooth line/.list=
@@ -1592,7 +2784,28 @@ data group {function classes};
A variant, where the legend is to the right, but aligned with the northern
end of the data visualization:
%
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
visualize as smooth line/.list=
@@ -1609,7 +2822,28 @@ data group {function classes};
\end{key}
\begin{key}{/tikz/data visualization/legend options/south east outside}
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
visualize as smooth line/.list=
@@ -1627,7 +2861,28 @@ data group {function classes};
\begin{key}{/tikz/data visualization/legend options/west outside}
The legend is placed left. Note that the text also swaps its position.
%
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
visualize as smooth line/.list=
@@ -1647,7 +2902,28 @@ data group {function classes};
\end{key}
\begin{key}{/tikz/data visualization/legend options/north west outside}
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
visualize as smooth line/.list=
@@ -1663,7 +2939,28 @@ data group {function classes};
\end{key}
\begin{key}{/tikz/data visualization/legend options/south west outside}
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
visualize as smooth line/.list=
@@ -1683,7 +2980,28 @@ data group {function classes};
The legend is placed above the data. Note that the legend entries now for a
row rather than a column.
%
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
visualize as smooth line/.list=
@@ -1703,7 +3021,28 @@ data group {function classes};
\end{key}
\begin{key}{/tikz/data visualization/legend options/south outside}
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
visualize as smooth line/.list=
@@ -1734,7 +3073,28 @@ coordinate given by a certain data point.
\begin{key}{/tikz/data visualization/legend options/south east inside}
Puts the legend in the upper right corner of the data.
%
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
visualize as smooth line/.list=
@@ -1796,7 +3156,28 @@ rather than a column for the legend entries:
is now a little smaller since there tends to be much less space inside the
data visualization than next to it.
%
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
visualize as smooth line/.list={log, lin},
@@ -1823,7 +3204,28 @@ can revert to directly setting the |at| and the |anchor| keys):
key--value pairs that specify a data point. The legend will then be
centered at this data point.
%
-\begin{codeexample}[width=6cm]
+\begin{codeexample}[
+ width=6cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
visualize as smooth line/.list={log, lin},
@@ -1839,7 +3241,28 @@ data group {function classes};
\begin{key}{/tikz/data visualization/legend options/right of=\meta{data point}}
Works like |at values|, but the anchor is set to |west|:
%
-\begin{codeexample}[width=6cm]
+\begin{codeexample}[
+ width=6cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
visualize as smooth line/.list={log, lin},
@@ -1897,7 +3320,28 @@ first have a look at the keys that allow us to save a set of such styles:
|/tikz/data visualization/legend entry options|. Thus, this key can use
keys like |node style| to configure the styling of all text nodes:
%
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
every label in legend/.style={node style=
@@ -1920,7 +3364,28 @@ data group {function classes};
This key can be used with a legend. It will simply add the \meta{options}
to the |every label in legend| style for the given legend.
%
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
visualize as smooth line/.list=
@@ -1945,7 +3410,28 @@ The appearance of the text nodes is easy to configure.
\begin{key}{/tikz/data visualization/legend entry options/node style=\meta{options}}
This key adds \meta{options} to the styling of the text nodes of the label.
%
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
visualize as smooth line/.list=
@@ -1967,7 +3453,28 @@ data group {function classes};
effect of this is that the label's text will have the same color as the
data set to which it is attached.
%
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
visualize as smooth line/.list=
@@ -1997,7 +3504,28 @@ visualization.
\begin{key}{/tikz/data visualization/legend entry options/text left}
Placed the text node to the left of the data set style visualization.
%
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
visualize as smooth line/.list=
@@ -2018,7 +3546,28 @@ data group {function classes};
options only makes sense in conjunction with the |text colored| options,
which is why this options is also selected implicitly.
%
-\begin{codeexample}[width=8cm]
+\begin{codeexample}[
+ width=8cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+ pre={\tikz \datavisualization data group {function classes} = {
+ data [set=log, format=function] {
+ var x : interval [0.2:2.5];
+ func y = ln(\value x);
+ }
+ data [set=lin, format=function] {
+ var x : interval [-2:2.5];
+ func y = 0.5*\value x;
+ }
+ data [set=squared, format=function] {
+ var x : interval [-1.5:1.5];
+ func y = \value x*\value x;
+ }
+ data [set=exp, format=function] {
+ var x : interval [-2.5:1];
+ func y = exp(\value x);
+ }
+};},
+]
\tikz \datavisualization [
scientific axes,
visualize as smooth line/.list=
@@ -2096,7 +3645,7 @@ for instance by |label in legend|:
picture. Typically, this will be a visual representation of the
data set styling, but it could also be something different.
%
-\begin{codeexample}[width=6cm]
+\begin{codeexample}[width=6cm,preamble={\usetikzlibrary{datavisualization}}]
\tikz \datavisualization [
school book axes, visualize as line/.list={a,b},
style sheet=vary dashing,
@@ -2180,7 +3729,7 @@ globally reconfiguring the default label in legend visualizers:
changing this style will change the appearance of lines in legends. The
main other sensible option for this key is |straight label in legend line|.
%
-\begin{codeexample}[width=5cm]
+\begin{codeexample}[width=5cm,preamble={\usetikzlibrary{datavisualization}}]
\tikz \datavisualization [
school book axes, visualize as line/.list={a,b},
style sheet=vary dashing,
@@ -2189,7 +3738,7 @@ data point [x=-1, y=-1, set=a] data point [x=1, y=0, set=a]
data point [x=-1, y=1, set=b] data point [x=1, y=0.5, set=b];
\end{codeexample}
%
-\begin{codeexample}[width=5cm]
+\begin{codeexample}[width=5cm,preamble={\usetikzlibrary{datavisualization}}]
\tikz \datavisualization [
school book axes, visualize as line/.list={a,b},
legend entry options/default label in legend path/.style=
@@ -2213,7 +3762,7 @@ data point [x=-1, y=1, set=b] data point [x=1, y=0.5, set=b];
default is to use |label in legend line one mark|. Another possible value
is |label in legend line three marks|.
%
-\begin{codeexample}[width=5cm]
+\begin{codeexample}[width=5cm,preamble={\usetikzlibrary{datavisualization}}]
\tikz \datavisualization [
visualize as scatter/.list={a,b,c},
style sheet=cross marks,
@@ -2251,7 +3800,7 @@ data point [x=-1, y=1, set=b] data point [x=1, y=0.5, set=b];
that is just a straight line, so it should start somewhere to the left of
the origin at height $0$ and go to the origin:
%
-\begin{codeexample}[width=5cm]
+\begin{codeexample}[width=5cm,preamble={\usetikzlibrary{datavisualization}}]
\tikz \datavisualization [
school book axes, visualize as line/.list={a,b},
style sheet=vary dashing,
@@ -2265,7 +3814,7 @@ data point [x=-1, y=1, set=b] data point [x=1, y=0.5, set=b];
Now let us make this a bit more fancy and useful by using shifted lines:
%
-\begin{codeexample}[width=5cm]
+\begin{codeexample}[width=5cm,preamble={\usetikzlibrary{datavisualization}}]
\tikz \datavisualization [
school book axes, visualize as line/.list={a,b},
legend={up then right}, style sheet=vary dashing,
@@ -2279,7 +3828,7 @@ data point [x=-1, y=1, set=b] data point [x=1, y=0.5, set=b];
In the final example, we use a little ``hat'' to represent lines:
%
-\begin{codeexample}[width=5cm]
+\begin{codeexample}[width=5cm,preamble={\usetikzlibrary{datavisualization}}]
\tikz \datavisualization [
school book axes, visualize as line/.list={a,b},
legend={up then right}, style sheet=vary dashing,
@@ -2306,7 +3855,7 @@ data point [x=-1, y=1, set=b] data point [x=1, y=0.5, set=b];
but usually it is not. In general, it is better to have marks for instance
not at the ends of the line.
%
-\begin{codeexample}[width=5cm]
+\begin{codeexample}[width=5cm,preamble={\usetikzlibrary{datavisualization}}]
\tikz \datavisualization [
school book axes, visualize as line/.list={a,b},
legend={up then right},
@@ -2335,7 +3884,7 @@ but use one of the following styles:
\begin{key}{/tikz/data visualization/legend entry options/straight label in legend line}
Just gives a straight line and two plot marks.
%
-\begin{codeexample}[width=5cm]
+\begin{codeexample}[width=5cm,preamble={\usetikzlibrary{datavisualization}}]
\tikz \datavisualization [visualize as line,
line={style={mark=x}, label in legend={text=example,
straight label in legend line}}];
@@ -2346,7 +3895,7 @@ but use one of the following styles:
distinguish -- even though there is no problem distinguishing them in a
graph.
%
-\begin{codeexample}[width=5cm]
+\begin{codeexample}[width=5cm,preamble={\usetikzlibrary{datavisualization}}]
\tikz \datavisualization [visualize as line/.list={a,b,c},
legend entry options/default label in legend path/.style=
straight label in legend line,
@@ -2363,7 +3912,7 @@ but use one of the following styles:
plot marks are at the extremal points of the line. It works pretty well in
almost all situations and is the default.
%
-\begin{codeexample}[width=5cm]
+\begin{codeexample}[width=5cm,preamble={\usetikzlibrary{datavisualization}}]
\tikz \datavisualization [
visualize as line=a,
visualize as smooth line/.list={b,c},
@@ -2377,7 +3926,7 @@ but use one of the following styles:
optimal. This is the reason that the |cross marks| style uses different
crosses:
%
-\begin{codeexample}[width=5cm]
+\begin{codeexample}[width=5cm,preamble={\usetikzlibrary{datavisualization}}]
\tikz \datavisualization [
visualize as line/.list={a,b},
visualize as smooth line=c,
@@ -2394,7 +3943,10 @@ but use one of the following styles:
automatically selected for instance by the |polygon| or the |smooth cycle|
styles.
%
-\begin{codeexample}[width=7cm]
+\begin{codeexample}[
+ width=7cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+]
\tikz \datavisualization [
scientific axes={clean}, all axes={length=3cm},
visualize as line/.list={a,b,c},
@@ -2423,7 +3975,10 @@ data point [x=1, y=0.25, set=c];
This style is especially tailored to for the |gap cycle| style and
automatically selected by it:
%
-\begin{codeexample}[width=7cm]
+\begin{codeexample}[
+ width=7cm,
+ preamble={\usetikzlibrary{datavisualization.formats.functions}},
+]
\tikz \datavisualization [
scientific axes={clean}, all axes={length=3cm},
visualize as line/.list={a,b,c},
@@ -2454,7 +4009,7 @@ data point [x=1, y=0.25, set=c];
single mark (this is the default with a scatter plot or when the |no line|
is selected.
%
-\begin{codeexample}[width=5cm]
+\begin{codeexample}[width=5cm,preamble={\usetikzlibrary{datavisualization}}]
\tikz \datavisualization [visualize as scatter/.list={a,b,c},
style sheet=cross marks,
a={label in legend={text=example a}},
@@ -2467,7 +4022,7 @@ data point [x=1, y=0.25, set=c];
\begin{key}{/tikz/data visualization/legend entry options/label in legend three marks}
An alternative to the previous style, where several marks are shown.
%
-\begin{codeexample}[width=5cm]
+\begin{codeexample}[width=5cm,preamble={\usetikzlibrary{datavisualization}}]
\tikz \datavisualization [visualize as scatter/.list={a,b,c},
style sheet=cross marks,
a={label in legend={text=example a, label in legend three marks}},