Problem:
I am trying to get the function y = |x|
to work with data visualization library in TikZ but without success. It seems the issue is with the operator |
.
Minimal Working Example (MWE):
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization.formats.functions}
\begin{document}
\begin{tikzpicture}
\datavisualization [school book axes,
visualize as smooth line,
y axis={label},
x axis={label}]
data [format=function] {
var x : interval [-5:5];
func y = |x|;
};
\end{tikzpicture}
\end{document}
Desired output:
To get the function to work with the operator |
.