2013-12-03 12:12:43 +01:00
|
|
|
\documentclass[varwidth=true, border=2pt]{standalone}
|
|
|
|
|
|
|
|
\usepackage{pgfplots}
|
|
|
|
\usepackage{tikz}
|
|
|
|
|
|
|
|
\begin{document}
|
|
|
|
\begin{tikzpicture}
|
|
|
|
\begin{axis}[
|
|
|
|
legend pos=south west,
|
|
|
|
axis x line=middle,
|
|
|
|
axis y line=middle,
|
|
|
|
grid = major,
|
|
|
|
%width=9cm,
|
|
|
|
%height=9cm,
|
|
|
|
grid style={dashed, gray!30},
|
|
|
|
xmin=-1.5, % start the diagram at this x-coordinate
|
|
|
|
xmax= 1.5, % end the diagram at this x-coordinate
|
|
|
|
%ymin=-0.25, % start the diagram at this y-coordinate
|
|
|
|
%ymax= 2.25, % end the diagram at this y-coordinate
|
|
|
|
axis background/.style={fill=white},
|
|
|
|
xlabel=$x$,
|
|
|
|
ylabel=$y$,
|
|
|
|
%xticklabels={-2,-1.6,...,7},
|
|
|
|
%yticklabels={-8,-7,...,8},
|
|
|
|
tick align=outside,
|
|
|
|
minor tick num=-3,
|
|
|
|
enlargelimits=true,
|
|
|
|
tension=0.08]
|
2015-10-14 14:25:34 +02:00
|
|
|
\addplot[domain=-1.5:1.5, red, thick,samples=50] {x*x};
|
2013-12-03 12:12:43 +01:00
|
|
|
\draw[blue, thick] \pgfextra{
|
|
|
|
\pgfpathellipse{\pgfplotspointaxisxy{0}{1}}
|
|
|
|
{\pgfplotspointaxisdirectionxy{0.87}{0}}
|
|
|
|
{\pgfplotspointaxisdirectionxy{0}{0.87}}
|
2015-10-14 14:25:34 +02:00
|
|
|
% see also the documentation of
|
2013-12-03 12:12:43 +01:00
|
|
|
% 'axis direction cs' which
|
|
|
|
% allows a simpler way to draw this ellipse
|
|
|
|
};
|
2015-10-14 14:25:34 +02:00
|
|
|
\end{axis}
|
2013-12-03 12:12:43 +01:00
|
|
|
\end{tikzpicture}
|
|
|
|
\end{document}
|