# Drawing an ellipse inside a pgfplots semilog axis

I'm trying to draw an ellipse inside a semi-logarithmic pgfplots axis. The ellipse axes should be parallel to the coordinate axes, but depending on the radii I choose, the ellipse appears rotated.

Here's a MWE:

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\pgfplotsset{width=7cm}
\begin{document}
\begin{tikzpicture}
\begin{axis}[ymode=log]
(0,10) (1,300) (2,3347) (3,5000)
};
\draw
(axis cs:1,300) ellipse [
x radius = 1, y radius = 10];
\end{axis}
\end{tikzpicture}
\end{document}


which produces

How can I align the ellipse with the coordinate axes, so that they are parallel to the ellipse axes?

• Which version of pgfplots do you have? Feb 17, 2015 at 22:41
• @percusse Log file says document has been generated with the most recent feature set (\pgfplotsset{compat=1.9}. So version 1.9, I guess.
– Deve
Feb 17, 2015 at 23:16
• Can you update to the newest version (currently 1.12 but 1.11 is also fine)? Feb 17, 2015 at 23:27
• @percusse With a local installation, maybe. I can try tomorrow.
– Deve
Feb 17, 2015 at 23:31
• Adding rotate=-45 will get the horizontal ellipse, but that only works for your particular radii. found by trial and error. I know it's not a good solution, but if you need it now it will get you by. Feb 18, 2015 at 0:45

As a rule, I try to only do normal tikz AFTER \end{axis}. Instead I save coordinates for use later.

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\pgfplotsset{width=7cm}

\newlength{\rx}
\newlength{\ry}

\begin{document}
\begin{tikzpicture}
\begin{axis}[ymode=log]