I need to plot a variety of sine waves and almost have the graph looking exactly how I want. However, I am unable to remove the 0π or make it look like 3π/2.
\documentclass[tikz, border=5mm]{standalone}
\usetikzlibrary{datavisualization.formats.functions, arrows}
\def\mytypesetter#1{
\pgfkeys{/pgf/number format/precision=2}
\pgfmathparse{#1/pi}
\pgfmathroundtozerofill{\pgfmathresult}
\pgfmathifisint{\pgfmathresult}{
\pgfmathprintnumber{\pgfmathresult}$\pi$%}
}{
\pgfmathprintnumber[/pgf/number format/frac, frac whole=false]{\pgfmathresult}$\pi$
}
}
\begin{document}
\begin{tikzpicture}
\datavisualization [
school book axes,
all axes={
grid={
major={style={red!50!black, opacity=.25}},
minor={style={green!25!black, opacity=.25}},
minor steps between steps=3,
}},
x axis={
label=$\phi$,
ticks and grid={
stack,
step=(2*pi),
tick typesetter/.code=\mytypesetter{##1},
}},
y axis={
label=$v$,
grid={step=1}
},
style sheet=vary hue,
visualize as line/.list={sin1}
]
data [set=sin1, format=function] {
var x : interval [-2*pi:2*pi] samples 100;
func y = sin(\value x/2 r);
};
\end{tikzpicture}
\end{document}