i would like to lable my x-axis on a tikz-picture in π/4 increments, like in the wikipedia sin and cos graphic 1. This is my code (but it doesnt work):
\documentclass{scrartcl}
\usepackage{lmodern} % Schriftart
\usepackage[utf8]{inputenc} % Umlaute im Quellcode benutzen
\usepackage[T1]{fontenc} % Umlaute korrekt darstellen
\usepackage[ngerman]{babel} % Worttrennung
\usepackage[landscape, margin=20mm]{geometry}
\usepackage{blindtext}
\usepackage{tikz}
\pagestyle{empty}
\setlength\parindent{0mm}
\begin{document}
\blindtext
\begin{tikzpicture}[scale=2, domain=0:{2*pi}]
%\clip (-0.1,-0.2) rectangle (1.1,0.75); %Bildausschnitt
\draw[step=0.5,gray,very thin] (0,-1.4) grid (6.4,1.4); %Hintergrundgitter
\draw[->] (0,0) -- (6.5,0) node[right]{$x$}; %x-Achse
\draw[->] (0,-1.5) -- (0,1.5) node[above]{$y$}; %y-Achse
\foreach \x in {0\pi,0.5\pi,...\pi,2\pi}{$\x$}
\draw (\x,2pt) -- (\x,-2pt) node[below]{$\x$};
\foreach \y in {-1,-0.5, ...,1}
\draw(2pt,\y) -- (-2pt,\y) node[left]{$\y$};
\draw[color=red, very thick, smooth] plot (\x,{sin(\x r)});
\draw[color=blue, very thick, smooth] plot (\x,{cos(\x r)});
%\draw[smooth, variable=\x, blue] (0.0) plot ({\x}, {sin(\x r)});
\end{tikzpicture}
\end{document}



pgfplots(which usestikz) as that is specfically designed for graphing. An example that may help you get strted is Axis with trigonometric labels in PGFPlots. – Peter Grill Feb 28 '22 at 21:20