I have a problem with plotting contour plot with tikz. I have a mathematical function z=x^2+2*y^2 and I need to plot along log-axis as surface and contour. My code is
\documentclass[crop,tikz]{standalone}
\usepackage{tikz}
\usepackage{graphics}
\usepackage{pgfplots}
\usepackage{amsmath}
\begin{document}
\begin{figure}[hbt!]
\begin{tikzpicture}
\newcommand{\sample}{10}
\newcommand{\domain}{0.01:-4.6}
\newcommand{\kubesize}{6cm}
\begin{axis}[3d box=complete,
grid=major,
width=\kubesize,
height=\kubesize,
at={(1cm,18.5cm)},
scale = 1,
xlabel = {$\ln(\sigma_1)$},
xmin = ln(0.01), xmax = ln(0.99),
ylabel = {$\ln(\sigma_2)$},
ymin = ln(0.01), ymax =ln(0.99),
zlabel={$\ln(\Psi_A)$},
view/h=150,
]
\addplot3[%
surf,
samples=\sample,
domain=\domain,
y domain=\domain,
]
{ln(2*y^(2)+x^(2))};
\end{axis}
%A-opt countour
\begin{axis}[%
view={0}{90},
shader=interp,
3d box=complete,
%grid=major,
width=\kubesize,
height=\kubesize,
at={(9cm,18.5cm)},
scale = 1,
xlabel = {$\ln(\sigma_1)$},
xmin = ln(0.01), xmax = ln(0.99),
ylabel = {$\ln(\sigma_2)$},
ymin = ln(0.01), ymax =ln(0.99),
zlabel={$\ln(\Psi_A)$},
view/h=-180,
]
\addplot3[%
surf,
samples=\sample,
domain=\domain,
y domain=\domain,
]
{ln(2*y^(2)+x^(2))};
\addplot3 [contour gnuplot = {number=14, labels={false}, draw color=black},
samples=\sample,z filter/.code={\def\pgfmathresult{20}}]
{ln(2*y^(2)+x^(2))};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
I need some ideas to fix it.



unit vector ratio=1 1 0.5,to the options of the axis. Please note also that a figure environment makes only limited sense in a standalone document. – Dec 21 '18 at 18:02z filter/.code={\def\pgfmathresult{20}}toz filter/.code={\def\pgfmath result{20}}. – Katharina Dec 21 '18 at 20:03