I'm trying to plot a simple sqrt(x)
function and I get a weird looking one.
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis} [
smooth, no markers, grid,
domain=0:2,
xmax=2, ymax=2,
xmin=0, ymin=0]
\addplot +[red] {x^2};
\addplot +[blue]{sqrt(x)};
\addplot {x};
\end{axis}
\end{tikzpicture}
\end{document}
I'm plotting it together with x^2
and what I get is clearly not the inverse function: