The following is a MWE I made to test the use of \pgftransformnonlinear on a pgfplot (via TikZ's axis environment). It uses the following map:
.
(based on the answer here: Nonlinear transformation of tikzpicture according to a function)
In principal this works ok, but it doesn't really use the coordinates of the axis environment itself. Foe example, one can clearly see that the transformation isn't symmetric across the y axis as one would expect. I think this is because \pgftransformnonlinear works in a completely different coordiante system than that of the axis environment.
So my question is as follows: is there a way to apply non-linear transformations such that they use the coordinates of the internal axis environment?
Code:
\documentclass[preview]{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usepgfmodule{nonlineartransformations}
\pgfplotsset{compat=1.16}
\pgfkeys{
/pgfplots/vector plane/.style={
},
}
\makeatletter
\def\mytransformation{%
\pgfmathsetmacro{\myX}{\pgf@x}
\pgfmathsetmacro{\myY}{0.001*\pgf@x*\pgf@x+\pgf@y}
\setlength{\pgf@x}{\myX pt}
\setlength{\pgf@y}{\myY pt}
}
\makeatother
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{scope}
\pgftransformnonlinear{\mytransformation}
\begin{axis}[
width=10cm, height=10cm,
axis x line=middle,
axis y line=middle,
xlabel=$x$,
ylabel=$y$,
every axis x label/.style={
at={(ticklabel* cs:1.02)},
anchor=west,
},
every axis y label/.style={
at={(ticklabel* cs:1.02)},
anchor=south,
},
axis line style={stealth-stealth, thick},
label style={font=\large},
tick label style={font=\large},
xticklabels={,,},
yticklabels={,,},
samples=100,
xmin=-10, xmax=10,
ymin=-10, ymax=10,
grid=both,
major grid style={black!5},
minor grid style={black!5},
]
\end{axis}
\end{scope}
\end{tikzpicture}
\end{figure}
\end{document}
Result:

