I'm having trouble with my tikzpicture. I have the following code:
\begin{center}
\begin{tikzpicture}[scale = 1]
\begin{axis}[
axis x line=center,
axis y line=center,
legend entries={Creciente, Estrictamente Creciente},
legend pos=north,
xtick={-5,-4,...,5},
ytick={-5,-4,...,5},
xlabel={$x$},
ylabel={$y$},
xlabel style={below right},
ylabel style={above left},
xmin=-5.5,
xmax=5.5,
ymin=-5.5,
ymax=5.5]
\addlegendimage{no markers,magenta}
\addlegendimage{no markers,blue}
\addplot [
domain=-5:1,
samples=100,
color=magenta]
{x/2};
\addplot [
domain=1:2,
samples=100,
color=magenta]
{0.5};
\addplot [
domain=2:5,
samples=100,
color=magenta]
{(x/2)-0.5};
\addplot [
domain=-5:5,
samples=100,
color=blue]
{(x/2)+0.5};
\end{axis}
\end{tikzpicture}
\end{center}
The image looks ok but an error appears in the log: Package pgfkeys Error: Choice 'center' unknown in choice key '/pgfplots/legend pos'. I am going to ignore this key. I think that the problem are the legend entries but I can't figure out the error.

northis not a known value forlegend pos. – Jasper Habicht Aug 17 '22 at 08:33