Do my first steps with datavisualization. Find out how to plot functions. But the fourth function ist not in the plot. Found out that only the first three appear to be plotted out of the box. How can I make all four functions visible?
I would also like to have markings on the x axis in multiples of pi/2 and the label {\omega t} and stretch the plot double in y-direction.
\documentclass[border=5mm,tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization.formats.functions}
\begin{document}
\begin{tikzpicture}
\datavisualization [school book axes,
y axis=grid,
visualize as smooth line/.list={sinU,sinI,cosvarphi,sinP},
style sheet=strong colors,
style sheet=vary dashing,
sinU={label in legend={text=$U$}},
sinI={label in legend={text=$I$}},
cosvarphi={label in legend={text=$\cos(\varphi)$}},
sinP={label in legend={text=$P$}},
data/format=function
]
data [set=sinU] {
var x : interval [-0.25*pi:2.25*pi];
func y = sin((\value x +pi/6) r);
}
data [set=sinI] {
var x : interval [-0.25*pi:2.25*pi];
func y = sin((\value x -pi/6) r);
}
data [set=cosvarphi] {
var x : interval [-0.25*pi:2.25*pi];
func y = 0.5;
};
data [set=sinP] {
var x : interval [-0.25*pi:2.25*pi];
func y = 0.5 - cos((\value x *2) r);
};
\end{tikzpicture}
\end{document}
;
after third set of function drawing (due to it the last in not considered).