I am trying to plot an acos graph using tikz
and pgfplots
where the function should receive x-2
as an argument to plot the graph of acos(2-x)
which gives the acos(x) function a h-shift to the right and a reflection on the y-axis
\begin{tikzpicture}
\begin{axis}[
smooth,
no markers,
axis lines=center,
xlabel=$x$,
ylabel=$y$,
xmin=-1.0, xmax=1,
ymin=-0.2 , ymax=180,
]
\addplot[name path=A, domain=-1:1, samples=101]{acos(2-x)};
However, I always get the following error when compiling:
Missing number treated as zero
Illegal unit of measure (pt inserted)
Adding r at the end of the 2-x
does not help either.