% I tried using cosinus because it shows what I need to show, but im really not getting anywhere at this point.
\documentclass[a4paper,10pt]{article}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.3}
\begin{document}
\begin{figure}[h]
\begin{center}
\begin{tikzpicture}
\begin{axis}[
grid=both,
grid style={line width=.1pt, draw=gray!40},
axis lines=left,
ylabel=y,
xlabel=x]
\addplot[domain=0:4.5, samples=100, color=red]{cos(\x) r};
\addlegendentry{\cos(x)}
\end{axis}
\end{tikzpicture}
\end{center}
\end{figure}
\end{document}
cos(\x r)
? – Teepeemm Feb 25 at 15:43pgfplots
package! Upgrade it to recent version (1.17) ... – Zarko Feb 25 at 17:27compat=1.3
that does not mean that he has installed that version. (When I answer to questions I always state the minimal requiredcompat
level which gives the same result as the version I used to create that image, which I state in a comment in the first line of my code. – Stefan Pinnow Feb 26 at 13:25