I would like to locally override style sheet color and have:
- pin data the same color as the data set drawed
- be able to access the data set color in the "info" section
- wrong color for pin data for the data set "foo" ("x" is in black instead of green)
- wrong color in legend ("x" is black instead of green)
- no idea on how to set the text "foo / bar" to the desired color (foo in green and bar in red)
\documentclass{book}
\usepackage{tikz}
\usetikzlibrary {datavisualization.formats.functions}
\begin{document}
\tikz
\datavisualization[
scientific axes={clean},
visualize as smooth line/.list={foo,bar},
x axis={ grid={major also at=2} },
every data set label/.append style={text colored},
style sheet=strong colors,
foo={
style=green,
label in legend={text=$x$},
pin in data={text'=$x$, when=y is 1},
},
bar={
label in legend={text=$x/2$},
pin in data={text'=$x/2$, when=y is 1},
},
legend={below},
]
data [set=foo,format=function] {
var x : interval [0:5] samples 100;
func y = \value{x};
}
data [set=bar,format=function] {
var x : interval [0:5] samples 100;
func y = 0.5 * \value{x};
}
info {
\node at (visualization cs: x=1, y=2) {
foo / bar
};
};
\end{document}
