So I havethe code below to create a plot. Now I need to add a vertically dotted line at x = 1.5. Is it possible?
\documentclass[
12pt, % font size
a4paper, % paper format
oneside, % one-sided pages
]{report}
\usepackage{tikz} % draw figures
\usetikzlibrary{shapes,arrows}
\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization.formats.functions}
\usepackage{pgfplots} % discret signals
% math
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}
\datavisualization [school book axes,
visualize as smooth line/.list={one,two,three},
y axis={label={$u(t)$}},
x axis={label={$t$}},
one={style={black}},
two={style={red}},
three={style={orange}}]
data [set=one,format=function] {
var x : interval [-3:3];
func y = sin((\value x) r );
}
data [set=two,format=function] {
var x : interval [-3:3];
func y = sin((1.5 - \value x) r);
};
\end{tikzpicture}
\end{document}
{sin(x)}
as a y-coordinate (braces are needed to hide the parentheses from the parser), e.g.\draw[dashed] (1.5,0) -- (1.5,{sin(1.5 r)});