In pgfplots, I want to place the x^2 below the cos(x), as in the figure below.
I am trying to replicate the example from the manual, §4.19.3, but for some reason it seems that the syntax for node's positioning is different that that of tikz.
For example, in tikz, one can say
%\usetikzlibrary{positioning}
\node [below left=1pt and 2pt of n1.south west, anchor=south west] (n2) {node text};
to create a node n2 positioned relative to node n1.
Can anyone tell me why in my code the two
axiss are not one below the other?How can I add a
yshiftbetween the twoaxiss? (The package manual only mentions it and doesn't describe it)
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
\begin{axis}[name=myaxis,anchor=south east]
\addplot {cos(x)};
\end{axis}
\begin{axis}[at={(myaxis.below south west)},]
\addplot {x^2};
\end{axis}
\end{tikzpicture}
\end{document}

