I am trying to write a tutorial in which i want to so some sample graphs.
But, getting error when i try to plot graph using latex code.
\begin{tikzpicture}
\begin{axis}[xmin=-2, xmax=2, ymin=-2, ymax=2, axis lines=middle,
xlabel=$x$, ylabel=$y$]
\addplot[color=red, dashed, mark=*, samples=5, domain=-1:1]{x^2};
\addplot[color=blue]{1-x^2};
\end{axis}
\end{tikzpicture}
i tried this code. But got error.